HRT Algo Dev Intern OA 2022
Anonymous User
1827

given a list of cartesian coordinates x, y, return the number of squares that can be made from the coordinates. the next question was similar, but was rectangle instead of square.

ex: x = [-1, -1, -1, 0, 0, 0, 1], y= [-1, 0, 1, -1, 0, 1, 0], three squares can be made, so return 3
squares would formed from groups of points as follows: [[(-1,-1),(-1,1)(0,1),(0,0)],[(-1,0),(0,0),(-1,-1),(0,-1)],[(-1,0)(0,1),(1,0),(0,-1)]] Good luck!!

Comments (3)