2336. Smallest Number in Infinite Set
1 | class SmallestInfiniteSet { |
看会不会用TreeSet了. 算是集合了PriorityQueue和Set.
空间复杂度: O(n) n是addBack的次数.
Insist on doing small things, then witness the magic
1 | class SmallestInfiniteSet { |
看会不会用TreeSet了. 算是集合了PriorityQueue和Set.
空间复杂度: O(n) n是addBack的次数.