Given N points on a 2D plane, find the maximum number of points that lie on the same straight line.Problem Constraints
You will be given 2 arrays A and B. Each point is represented by (A[i], B[i])
1 <= |A| <= 500Input Format
|A| == |B|
-109 <= Ai, Bi <= 109
The first argument is an integer array A.Output Format
The second argument is an integer array B.
Return an integer.Example Input
A = [1, 2]Example Output
B = [1, 2]
The points on the 2D plane are (1, 1) and (2, 2). A line with the slope (m = 1) passes through both the points.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified.
Still have a question? Checkout Sample Codes for more details.