Closed tarilabs closed 7 years ago
Hi @tarilabs,
nice occurrences
implementation,
I think that is more clear than the current OccurrenceCountInMap
.
I just published the "rules", implementing sorting algorithm is required.
I suggest you to modify current java8
release dropping the OccurrenceCountInMap
class in favour your solution, really more representative of Java way.
For the next meeting it is preferable choose only one solution for a given language/version, so merging the current implementations would be nice.
As mentioned on the original conversation (email) sorting is pointless in this case; so I've added as step3 "for fairness" only as a forced guarantee when iterating back the occurrences
entries by key in their natural ordering with the default JDK implementation which is more representative. The comment is representative of this.
@tarilabs 👍 like it!
Proposal for a "vanilla" Java 8 version.