Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Put <code>1</code> and <code>m</code> into <code>hFences</code>. The differences of any two values in the new <code>hFences</code> can be a horizontal edge of a rectangle.
Similarly put <code>1</code> and <code>n</code> into <code>vFences</code>. The differences of any two values in the new <code>vFences</code> can be a vertical edge of a rectangle.
Our goal is to find the maximum common value in both parts.