The Minion Game

  • + 2 comments

    This solution has a nested loop and takes quadratic time, so the test cases it fails are most likely timeout errors. Try to think of a linear time solution (hint: you don't need to find all the substrings. You just need to know how many substrings start with every character.)