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.
1.winner(x) means who see this number x can win return True, elase will lose return False.
2. find results in memo.
3. find winner(x-2),winner(x-3),winner(x-5), any of them False then choose it can win--> return True.
4. if winner(x-2),winner(x-3),winner(x-5) all True, means choose any item always lose-->return False.
5.memorization the results in dict memo.
Game of Stones
You are viewing a single comment's thread. Return to all comments →
Python 3:
1.winner(x) means who see this number x can win return True, elase will lose return False. 2. find results in memo. 3. find winner(x-2),winner(x-3),winner(x-5), any of them False then choose it can win--> return True. 4. if winner(x-2),winner(x-3),winner(x-5) all True, means choose any item always lose-->return False. 5.memorization the results in dict memo.