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.
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below:
my solutions
deftower_breakers(n,m):# Time complexity: O(1)# Space complexity (ignoring input): O(1)# If number of towers is pair, whatever player 1 does, player 2 mimics and wins.# If n is odd, player 1 push a tower to 1 and the game becomes a n is pair caseifm==1:return2ifn%2==0:return2else:return1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tower Breakers
You are viewing a single comment's thread. Return to all comments →
Python best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions