You are not logged in. Please login at to post your questions!


[closed] Where have I made mistake?

I am trying to solve this problem. I am checking from a given state, which subsets we can go to and finding sprague-grundy 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.

My solution

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

dragonemperor's gravatar image

accept rate: 10%

closed 14 Sep '15, 08:31

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 reverse-sorted arrays were considered sorted.


answered 14 Sep '15, 08:31

dragonemperor's gravatar image

accept rate: 10%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 09 Sep '15, 15:56

question was seen: 696 times

last updated: 14 Sep '15, 08:31