FAANG | on-site | Given 4 points, does it make a rectangle?
Anonymous User
3423

Hi All,

I was asked this question in a faang on-site.
Given 4 points on a xy plane. Determine if it makes a rectangle or not?
Example:
public boolean isRectangle([2,2], [0,0], [2,0], [0,2])
return true if forms a rectangle else false
I am unsure of how to code this solution. Please help me find the solution for this.
Maybe its to do with finding the slope or area, I'm not sure.
Thanks a lot

Comments (7)