A String Game

I have been trying to solve the problem A String Game since a few days, but the logic has not struck me yet. I even tried to understand a few accepted solutions, but without any luck. Can anyone give any hints regarding the logic? Any special programming prerequisites for solving the problem?

Check out the editorial at December 2010 Contest Problem Editorials | CodeChef

You need to know some game theory to solve this problem. The tutorial at topcoder Topcoder is a nice place to start with.

1 Like