[LeetCode] Maximum Square Area by Removing Fences From a Field

1 · · Dec. 24, 2023, 4:05 a.m.
10036. Maximum Square Area by Removing Fences From a Field There is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays hFences and vFences respectively. Horizontal fences are from the coordinates (hFences[i], 1) to (hFences[i], n) and vertical fences are from the coordinates (1, vFences[i]) to (m, vFences[i]). Return the maximum area of a square field that can be formed by removing some fences (possibly no...