Company: Capital One Onccampus_11june
Difficulty: easy
Rectangle Storage Queries A storage system processes a list of operations . Each operation is a triple [type, a, b] and there are two types: [0, a, b] — save a rectangle whose sides are a and b . [1, a, b] — ask : could every rectangle saved so far be placed inside a box whose sides are a and b ? A rectangle may be rotated by 90 degrees, so a rectangle with sides a and b may also be used as b × a . The rectangles are tried in the box one at a time , not all together — the answer is true when each saved rectangle would fit on its own. Operations are processed in order: when operations[i] runs, only operations 0, 1, ..., i - 1 have happened. A query therefore sees exactly the rectangles saved before it, and a query that runs before any rectangle has been saved is vacuously true . Report the answers to the query operations, in the order the queries appear. Input Format A single array literal, exactly as it would be written in source code: [[t,a,b],[t,a,b],...,[t,a,b]] Whitespace and line