Algorithm · Ebay · Medium
You are processing a stream of rectangle operations. Each operation either records a new rectangle or asks whether every rectangle recorded so far can fit inside a given bounding box. Operations must be handled in the order they appear. You are given an array operations, where each element is a triple [type, a, b]: [0, a, b] – Record a rectangle with dimensions $$a \times b$$. [1, a, b] – Query: can every rectangle that was recorded before this operation fit individually…
Checking your access…