Points in a Straight Line

You are given a two dimensional array containing arrays of integer pairs as an argument. The integer pairs represent points that lie on a two dimensional plane. Return the number of points from the 2D array that lie on a straight line.

Requirements

  • Must return a single integer

Example #1

solve([[0, 0], [1, 1], [2,2], [4, 5], [7, 2]])
> 3

We return 3 since the points \[0, 0], \[1, 1], \[2,2] all lie on a single line