Algorithm · Ebay · Hard
(This problem is a twist on LeetCode 3161. Block Placement Queries. Solving that one first is a good warm-up.) You receive a sequence of operations that act on an unbounded number line at non-negative integer locations. Two operation kinds exist: [1, x]: Drop an obstacle exactly at position x. [2, x, size]: Perform a span check. Inspect the interval [x - size, x - 1] — a contiguous block of size positions ending right before x. Add "1" to your output string when the interval…
Checking your access…