If given a string such as , "aaabbccc", how would you output 'a' since it occurs just as frequently as 'c' but occurs first.
I did it using O(n) time, but I can't figure out how you would do this using log(n) time, whether in java or c++.
Aucun commentaire:
Enregistrer un commentaire