Skip to content

2005. Subtree Removal Game with Fibonacci Tree 👎

  • Time: $O(1)$
  • Space: $O(1)$
1
2
3
4
5
6
class Solution {
 public:
  bool findGameWinner(int n) {
    return n % 6 != 1;
  }
};
1
2
3
4
5
class Solution {
  public boolean findGameWinner(int n) {
    return n % 6 != 1;
  }
}
1
2
3
class Solution:
  def findGameWinner(self, n: int) -> bool:
    return n % 6 != 1