I stumbled upon the implementation of a TreeSet in which, by the condition of the problem, you need to do sorting in ascending order without repeats and in one of the showy solutions they do it simply through TreeSet ... But as I recall, TreeSet does not remove repetitions but simply adds in increasing order ... Or ?
|
TreeSetsameness does not depend on equals, but on compare / compareTo. - Roman