A trivial change makes the new implementation O(log(N)) instead of O(log(N))+O(M) when there are M repeated scores!
Attach a file by drag & drop or click to upload