# Coding Ninjas problem help in approach

**URL:** <https://discuss.codechef.com/t/coding-ninjas-problem-help-in-approach/86320>\
**Category:** general\
**Tags:** help, c-plus-plus, codechef, easy, editorial, medium, wa\
**Created:** [March 1, 2021, 5:24pm UTC](https://discuss.codechef.com/t/coding-ninjas-problem-help-in-approach/86320 "2021-03-01T17:24:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![karnikkanojia](https://discuss.codechef.com/user_avatar/discuss.codechef.com/karnikkanojia/32/24429_2.png) [@karnikkanojia](https://discuss.codechef.com/u/karnikkanojia)\
**Post date:** [March 2, 2021, 5:23pm UTC](https://discuss.codechef.com/t/coding-ninjas-problem-help-in-approach/86320/3 "2021-03-02T17:23:34Z")

</div>

Hey I was doing the same problem for code ninjas. I didn’t get the answer for this and wasn’t able to do it. Kind of a hint I could give but that is all I have.

You see in game theory we have two states for game. Winning State and Non-Winning state. You can find that all Non-Winning states are 1,3,7,15 and so forth, which follows the patter of 2^n-1. where 1\<=n\<=64. That are all the non-winning states. So if A comes on a Non-Winning state. There exists no number with which n&x==0.

---

_[View the full topic](https://discuss.codechef.com/t/coding-ninjas-problem-help-in-approach/86320)._
