Rectangle Grid with Replace, Remove, Undo and Batch Remove
Problem
Maintain a 2D integer grid to which rectangles with unique IDs can be added. A rectangle (x1, y1, x2, y2) is a closed range covering every cell with x1 ≤ x ≤ x2 and y1 ≤ y ≤ y2. Support th...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
