Algorithm · Roblox · Medium
Consider an integer number line that stretches infinitely in both directions and starts out completely free of obstacles. You are given a list operations and must handle each one in the order it appears. There are two kinds of operations: [1, x] puts a new obstacle at the integer coordinate x. You may rely on the fact that x is unoccupied at the moment this operation runs. [2, x, size] asks whether a block whose center is x and which reaches size - 1 units to the left and to…