NewThe Learning module is now liveSee what's new

(This question is a variation of the LeetCode question 3161. Block Placement Queries. If you haven't completed that question yet, it is recommended to solve it first.)

You are given a list of operations on an infinite number line of non-negative integer positions. Each operation is one of two types:

  • [1, x]: Place an obstacle at position x.
  • [2, x, size]: Block check. Checks whether any obstacle exists in the range [x - size, x - 1] (exactly size consecutive positions). Appends "1" to the result if the range is clear, or "0" if at least one obstacle is present. Position x itself is not included in the checked range. Block checks are read-only and do not modify the obstacle state.
Test Cases
Input
Output
Expected