Back to problems

Maximize Hole in Prison Gate

Algorithm · Expedia · Medium

This task is adapted from LeetCode 2943, “Maximize Area of Square Hole in Grid.” A prisoner is planning an escape. The gate consists of n horizontal bars and m vertical bars, spaced one unit apart, so every opening initially has size $$1 \times 1$$. The prisoner can remove some of the bars, causing neighboring openings to merge into larger holes. Implement max_hole_area(n, m, hBars, vBars), where hBars and vBars contain 1-indexed positions of the horizontal and vertical bars…

Checking your access…