I was asked this Interview Question (C++,algos)and had no idea how to solve it.
Given an array say Arr[N] containing Cartesian coordinates of N distinct points count the
If it's 2 dimension points: 3 points (P,Q,R) are collinear if (P,Q), (P,R) define the same slope.
m = (p.x - q.x) / (p.y - q.y) ; slope
Somehow you need to check all possible combinations and check, an efficient algo is trick as the first naive is N*(N-1)*(N-2)...