It can be solved by maintaining a maximum rating and a lexicographically minimum handle having the maximum rating.

Just iterate through all the handles and update maximum rating and lexicographically minimum handle having the maximum rating as needed. (string comparing will be helpful here)

Statistics

88% Solution Ratio
FairoozREarliest, Jun '20
Moumi_Fastest, 0.0s
FairoozRLightest, 131 kB
bokaifShortest, 155B
Toph uses cookies. By continuing you agree to our Cookie Policy.