Search
⌘K

Leetcode 2975. Maximum Square Area by Removing Fences From a Field

Given positions of removable interior horizontal and vertical fences (with the outer borders fixed), choose two horizontal and two vertical lines (removing others) so the distance between the chosen horizontal lines equals the distance between the chosen vertical lines to form a square; return the maximum such square area modulo 1e9+7 or -1 if no matching side length exists.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.