Algorithm · Capital One · Hard
Consider a number line that extends without bound in both directions. You will process a list of actions of two kinds. The first kind drops a blocker onto a given position. The second kind describes a board by its starting position and its length, and asks whether that board could be laid down without overlapping any blocker. Your job is to answer every placement question in the action list. In a recent OA version, each action is an integer array: An action of length 2, [1,…