We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Another approach:
if the x coordinate is in [max_x, min_x] or the y_coordinate is in [max_y, min_y] for every point in the set, then it is a rectangle parallel to the axes because otherwise there would either be a point outside or inside the rectangle
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Points on a Rectangle
You are viewing a single comment's thread. Return to all comments →
Another approach: if the x coordinate is in [max_x, min_x] or the y_coordinate is in [max_y, min_y] for every point in the set, then it is a rectangle parallel to the axes because otherwise there would either be a point outside or inside the rectangle