Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
We can enumerate all the upper-left and lower-right corners.
If the upper-left corner is <code>(x1, y1)</code> and lower-right corner is <code>(x2, y2)</code>, check that there is no point <code>(x, y)</code> such that <code>x1 <= x <= x2</code> and <code>y2 <= y <= y1</code>.