For example consider the following points : (0,0) (1,1) (0,1) (1,2) (1,0) (2,1)
There are three parallel lines in the above set, all with a slope = 1, but (0,0) and (0,1) lie on different lines.
Most of the solutions I saw have this code
slope = (double)(yj - yi) / (double)(xj - xi);
if(map.containsKey(slope)) map.put(slope, map.get(slope) + 1); else map.put(slope, 1);
How is this being checked?