Problem Description
Given N points on a 2D plane, find the maximum number of points that lie on the same straight line.
You will be given 2 arrays A and B. Each point is represented by (A[i], B[i])
Problem Constraints
1 <= |A| <= 500
|A| == |B|
-109 <= Ai, Bi <= 109
Input Format
The first argument is an integer array A.
The second argument is an integer array B.
Output Format
Return an integer.
Example Input
A = [1, 2]
B = [1, 2]
Example Output
2
Example Explanation
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.