There are three towers.
The objective of the game is to move all the disks over to tower #3, but you can't place a larger disk onto a smaller disk. To play the game or learn more about the Tower of Hanoi.
Create a function that takes a number of discs
as an argument and returns the minimum amount of steps needed to complete the game.
towerOfHanoi(3) ➞ 7
towerOfHanoi(5) ➞ 31
towerOfHanoi(0) ➞ 0
- The amount of discs is always a positive integer.
- 1 disc can be changed per move.