Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Maintain the frequency of all the points in a hash map.
Traverse the hash map and if any point has the same y-coordinate as the query point, consider this point and the query point to form one of the horizontal lines of the square.