Python, binary index tree solution with explanation
type 2 query means if there has any gap in [0, x]  and its size >= sz.\nAnd for type 2, we find the obstacle most close to position x on left,\nfind the prefix 
type 2 query means if there has any gap in [0, x]  and its size >= sz.\nAnd for type 2, we find the obstacle most close to position x on left,\nfind the prefix max of [0, the obstacle position], and a gap is [the obstacle position, x].\n\nBut when we put more obstacles, gaps are getting smaller, and we should update the prefix max value in [0, the obstacle position] -> p[the obstacle position].\n\n\nthe binary index tree can not handle this, the limit is that p[the obstacle position] becomes increasing.\n\nSo, we can do the query reversely,\nputting a obstacle becomes deleting a obstacle, so that p[the obstacle position] becomes increasing.\n\nwhen we delete a obstacle, find its previous obstacle and next obstacle,\nupdate prefix max value of next obstacle with distance between previous and next.\n\n\ntc is O(qlogq), sc is O(q).\n\n```python\nfrom sortedcontainers import SortedList\nclass BIT:\n    def __init__(self, size):\n        self.bit = [0] * (size + 1)\n    def update(self, pos, value):\n        pos += 1\n        while pos < len(self.bit):\n            self.bit[pos] = max(self.bit[pos], value)\n            pos += pos & -pos\n    def pre_max(self, pos):\n        pos += 1\n        res = 0\n        while pos > 0:\n            res = max(res, self.bit[pos])\n            pos -= pos & -pos\n        return res\n\nclass Solution:\n    def getResults(self, queries: List[List[int]]) -> List[bool]:\n        mx = max(q[1] for q in queries) + 1\n        pos = [0] + sorted([q[1] for q in queries if q[0] == 1]) + [mx] # mx prevent index out of range, there is no type 2 query on its right\n        bit = BIT(len(pos))\n        for i in range(1, len(pos)):\n            i += 1\n            bit.bit[i] = max(bit.bit[i], pos[i-1] - pos[i-2])\n            p = i + (i & -i)\n            if p < len(bit.bit):\n                bit.bit[p] = max(bit.bit[p], bit.bit[i])\n\n        sl = SortedList(pos)\n        ans = []\n        for q in reversed(queries):\n            x = q[1]\n            i = sl.bisect_left(x)\n            left = sl[i-1]\n            if q[0] == 1:\n                sl.discard(x)\n                right = sl[i]\n                bit.update(bisect_left(pos, right), right - left)\n            else:\n                mx_gap = max(bit.pre_max(bisect_left(pos, left)), x - left)\n                ans.append(mx_gap >= q[2])\n        return ans[::-1]\n```
['Binary Indexed Tree', 'Python']