I’m trying to solve the problem of “count ways to reach the nth step in a staircase” with recursion. When given a number of stairs to climb, I have to calculate the number of ways to climb taking either 1 or 2 steps at a time. For example, if there are 4 stairs, we would return 5 since we would
Tag: recursive-backtracking
Array from recursive call being overwritten
We’re making a program to solve an asterisk sudoku via a recursive approach with back tracking. The solveIt method calls the solve method which is the recursive method. grid is declared before to be a 9×9 2D array that contains the puzzle to be filled in. If there is one solution, the program must print out the completed puzzle however