We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Game Theory
- Stone Piles
- Discussions
Stone Piles
Stone Piles
Sort by
recency
|
24 Discussions
|
Please Login in order to post a comment
thnmks for share
A strong sentence is the cornerstone of an engaging piece of writing writing. Be prepared with a tool that makes it easier to weave entire text : , which will make your narratives flow more naturally. No more speculating; just clarity and involvement in each phrase.
Grundy numbers for 0:0,1:0,2:0,3:1,4:0,5:2,6:3,7:4,8:0 Grundy number for n>=9 = n-4
Using Grundy Numbers following code:
def stonePiles(arr): maps = {0:0,1:0,2:0,3:1,4:0,5:2,6:3,7:4,8:0} res = 0 for ele in arr: if ele<=8: res^=maps[ele] else: res^=(ele-4) if res == 0: return 'BOB' else: return 'ALICE'
Hi, I find the blog informative, though... nice work... do share such information. I’ll bookmark your website. Our website nirogayurved is an Ayurved-related website and on our website, you will get all information related to piles and the cure of ayurvedic medicine for piles Problem.