I try to solve this question by SortedSet, but compile-error happens to the following line of code.
SortedSet<Long> set = new TreeSet<Long>();
I've just included SortedSet by default. You should be able to use it without explicitly importing it now.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.