Create MaxPointsOnALine.java

The idea here is that we can define a line by using two points. For every point (we call it original point), we scan to the right and if any two points forms the same slope with the original point, they must be on the same line. We do not need to scan to the left because they have already been considered if we start the original point from the left. Hashmap is the data structure we use to record the number of visited slopes.

First notice that we need to variable to keep track of the number of samePoints in case there are any duplicate points. Second the Infinity and zero need to be taken care of.