JAVA SOLUTION
Intuition\n\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Tim
# Intuition\n![images.jpeg](https://assets.leetcode.com/users/images/45e39920-d68a-452e-850e-55dee4034d8d_1721110574.589863.jpeg)\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimport java.util.*;\n\nclass Solution {\n    public List<Boolean> getResults(int[][] queries) {\n        NavigableMap<Integer, Integer> startEnd = new TreeMap<>();\n        startEnd.put(0, 50000);\n        NavigableMap<Integer, NavigableSet<Integer>> lenStart = new TreeMap<>();\n        NavigableSet<Integer> set = new TreeSet<>();\n        set.add(0);\n        lenStart.put(50000, set);\n        List<Boolean> result = new ArrayList<>();\n        for (int[] query : queries) {\n            if (query[0] == 1) {\n                int x = query[1];\n                int prev = startEnd.floorKey(x);\n                int end = startEnd.get(prev);\n                startEnd.put(prev, x);\n                startEnd.put(x, end);\n                NavigableSet<Integer> starts = lenStart.get(end - prev);\n                if (starts.size() == 1) {\n                    lenStart.remove(end - prev);\n                } else {\n                    starts.remove(prev);\n                }\n                lenStart.computeIfAbsent(x - prev, a -> new TreeSet<>()).add(prev);\n                lenStart.computeIfAbsent(end - x, a -> new TreeSet<>()).add(x);\n            } else {\n                int x = query[1];\n                int sz = query[2];\n                Integer size = lenStart.ceilingKey(sz);\n                boolean found = false;\n                while (size != null) {\n                    int firstStart = lenStart.get(size).first();\n                    if (x - firstStart >= sz) {\n                        found = true;\n                        result.add(true);\n                        break;\n                    }\n                    size = lenStart.higherKey(size);\n                }\n                if (!found) {\n                    result.add(false);\n                }\n            }\n        }\n        return result;\n    }\n}\n```
['Java']