Leetcode Problem 2005. Subtree Removal Game with Fibonacci Tree

2005. Subtree Removal Game with Fibonacci Tree

Leetcode Solutions

Modulo Operation Based on Sprague-Grundy Theorem

  1. Check if n is congruent to 1 modulo 6.
  2. If it is, return false because Alice will lose.
  3. If it is not, return true because Alice can win by playing optimally.
UML Thumbnail

Dynamic Programming Approach

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...