I am trying to solve this problem. I am checking from a given state, which subsets we can go to and finding spraguegrundy function. When I am printing the functions, I am getting wrong answer. It is correct for first sample test, but for the second one, it is incorrect. p.s. I changed the last few lines in solve function (for variable ans), but I think last one wasn't incorrect as well asked 09 Sep '15, 15:56

The question has been closed for the following reason "Other" by dragonemperor 14 Sep '15, 08:31
Never mind. I got it. The function checking for sorting was checking in reverse order. So reversesorted arrays were considered sorted. answered 14 Sep '15, 08:31
