Stores the count of all possible distances in X [ ] & Y [ ] respectively
HashMap < Integer , Integer > m1 = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > m2 = new HashMap < Integer , Integer > ( ) ; int i , j , ans = 0 ;