You are given two arrays of positive integers, boxes and warehouse, representing the heights of various boxes of unit width and the heights of
Boxes can be pushed into the warehouse from either the left entrance (room
Each room can hold at most
A box cannot pass through any room that has a height strictly less than the height of the box.
Once a box is placed in a room, it remains there and cannot be moved, preventing any other boxes from passing through that room.
Return the maximum number of boxes that can be placed in the warehouse.
Constraints:
n warehouse.length
boxes.length, warehouse.length
boxes[i], warehouse[i]
You are given two arrays of positive integers, boxes and warehouse, representing the heights of various boxes of unit width and the heights of
Boxes can be pushed into the warehouse from either the left entrance (room
Each room can hold at most
A box cannot pass through any room that has a height strictly less than the height of the box.
Once a box is placed in a room, it remains there and cannot be moved, preventing any other boxes from passing through that room.
Return the maximum number of boxes that can be placed in the warehouse.
Constraints:
n warehouse.length
boxes.length, warehouse.length
boxes[i], warehouse[i]