Boundary contraction [mp]
Micro pattern¶
Description¶
Represent an unprocessed region with boundaries and move them inward after processing an edge.
Problems¶
Matrix layers¶
Traverse exposed edges before shrinking a rectangular region.
- 54. Spiral Matrix (Top Hard)
Two-ended boundaries¶
Move the side whose current value determines a safe local decision.
- 11. Container With Most Water (Top Hard)
- 42. Trapping Rain Water (Top Hard)