EPIJudge
EPIJudge copied to clipboard
Simplified and a bit more optimized solution
Using map's getOrDefault significantly reduces conditional checks required. I have also modified the solution a bit to only require a single pass. Further, since we're adding the results in a single pass, we don't care about swapping/changing indexes before the current index, which also halves hash table modifications required.
This is my first pull request, so I apologize in advance if I made a mistake.
Hi @FusionX9000 ,
Very good solution to simplify the code, and I am impressed. We will merge that in the future, and please be patient on this.