Pages - Menu

Saturday, 28 March 2020

Staircase Problem DP Based Solution

HERE IS THE CODE

Stair Case Problem

The problem statement for staircase problem is

Suppose there are n stairs and a person wants to reach the top. The person can climb either 1 stair or 2 stairs or 3 stairs at a time. Find the minimum number of steps to reach the top.

Find nth fibonacci number naive and DP Based

Fibonacci numbers form a sequence such that each number is the sum of the two preceding ones.
Fibonacci numbers start from 0, 1.
 and
 for n > 1