Query Box Inside Every Saved Rectangle
Problem statement
Process operations:
[0,a,b]saves an a by b rectangle.[1,a,b]asks whether the query box can fit inside every saved rectangle separately.
Allow 90-degree rotation. Return query booleans in order; with no saved rectangles, return true.
Function
queryBoxesFitSavedRectangles(operations: int[][]) → boolean[]Examples
Example 1
operations = [[0,3,3],[0,5,2],[1,3,2],[1,2,4]]return = [true,false]3x2 fits both saved rectangles after rotation choices; 2x4 cannot fit inside 3x3.
Example 2
operations = [[1,100,100]]return = [true]No rectangles have been saved.
Constraints
1 <= operations.length <= 100000- All side lengths are positive.