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 http://www.codechef.com/wiki/december-2010-contest-problem-editorials

You need to know some game theory to solve this problem. The tutorial at topcoder http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=algorithmGames is a nice place to start with.

1 Like