Leetcode solution for max points on a line problem