Issue with Test Cases


#1

When I am submitting my code:

public  int maxPoints(ArrayList<Integer> a, ArrayList<Integer> b) {
	int pts = 1;
	if(a.size()<1)
		return 0;
	for(int i = 0; i<a.size()-1; i++) {
		Map<Double, Integer> map = new HashMap<Double, Integer>();
		int x1= a.get(i);
		int y1 = b.get(i);
		for(int j=i+1; j<a.size(); j++) {
		    if(j==i)
		        continue;
			int x2 = a.get(j);
			int y2 = b.get(j);
			double m = Double.MAX_VALUE;
			if(x1==x2) {
				m = Double.MAX_VALUE;
			}else if(y1==y2) {
				m = 0;
			}else {	
				m = (double)(y2 - y1)/(double)(x2 - x1);
				if(m == 0)
					m = 0;
			}
							
			int present = 1;
			if(map.containsKey(m)) {
				present += map.get(m);
			}else {
				present++;					
			}
			map.put(m, present);
			pts = Math.max(pts, present);
		}
	}
	
	return pts;
}

I get the following error:
77,14,-2,-17,-3,2,3,-13,-5,-18,6,9,-10,15,5,2,11,-3,18,-7,-1,-10,-13,14,-6,-2,13,-18,-14,-7,-1,12,-19,1,-13,-9,2,-16,-6,-4,-3,11,2,-4,-2,-16,-11,17,5,5,-13,8,18,-16,-15,-8,12,5,5,4,14,16,2,14,8,-12,4,13,-20,2,-1,-14,-1,-9,-16,20,20,-5,-9,-19,-2,-16,0,-19,1,3,-4,3,-1,1,-20,-18,-2,19,-9,11,2,-16,10,10,-12,12,4,-5,12,-1,-3,-5,2,-17,3,-20,4,18,-1,-15,10,-3,19,-5,-17,17,14,14,7,0,17,0,5,3,-9,10,-13,13,6,10,18,15,1,2,2,19,4,-14,6,-17,6,4,-3,6,7,1,18,12,18

Expected:7
Returned:6

But if I submit changing to for(int j=i+1; j<a.size(); j++)
My code is submitted successfully though when testing locally, I am still getting 6 as output, but getting 7 in InterviewBit
Can Anyone suggest?