NextK can be made faster
Opened this issue · 0 comments
parikg commented
Currently NextK uses RBTreeMap. This probably takes O(log N) for membership and finding max. We can replace it with a hashmap + priority queue, which will reduce membership time to O(1).