Skip to content

Comments

292. Nim Game.cpp#3

Merged
Subhosjx merged 3 commits intoSubhosjx:mainfrom
SjxSubham:main
Oct 27, 2025
Merged

292. Nim Game.cpp#3
Subhosjx merged 3 commits intoSubhosjx:mainfrom
SjxSubham:main

Conversation

@SjxSubham
Copy link
Contributor

Intuition

The intuition behind the soln comes from tricks used in similar games where multiple of 4 is used as a trick to win

Approach

  • If the number is less than or equal to 3, you can win in one move so we return true
  • For greater numbers, you will win everytime if n is not a multiple of 4 (if played perfectly as mentioned in the problem statement)

@Subhosjx Subhosjx added the hacktoberfest-accepted hacktoberfest-accepted label Oct 27, 2025
@Subhosjx Subhosjx merged commit 7d0ef91 into Subhosjx:main Oct 27, 2025
1 check passed
@github-actions
Copy link

🎉 Congrats on getting your PR merged in, @SjxSubham! 🙌🏼

Thanks for your contribution every effort helps improve the project.

Looking forward to seeing more from you! 🥳✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants