Question 11
EasyYou can climb 1 or 2 steps at a time. In how many ways can you climb a staircase of 5 steps?
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Data Structures and Algorithms
You can climb 1 or 2 steps at a time. In how many ways can you climb a staircase of 5 steps?
13
10
8
5
Sign up free to see the answer and a step-by-step explanation.
With F(0) = 0 and F(1) = 1, what is the 10th Fibonacci number F(10)?
89
45
34
55
Sign up free to see the answer and a step-by-step explanation.
With coins {1, 5, 6, 9}, what is the least number of coins needed to make 11?
4
1
3
2
Sign up free to see the answer and a step-by-step explanation.
What is the length of the longest common subsequence of 'ABC' and 'AC'?
2
0
3
1
Sign up free to see the answer and a step-by-step explanation.
Moving only right or down, how many paths lead from the top-left to the bottom-right corner of a 3 × 3 grid of cells?
3
4
6
9
Sign up free to see the answer and a step-by-step explanation.
0/1 knapsack: capacity 5, items (weight, value) = (2, 3), (3, 4), (4, 5). What is the best total value?
5
9
8
7
Sign up free to see the answer and a step-by-step explanation.
In a one-dimensional DP solution, what does dp[i] usually stand for?
The number of loops
The answer to the subproblem of size i (for example, the first i items)
The i-th input element
A random value
Sign up free to see the answer and a step-by-step explanation.
What is the edit distance (insertions, deletions and substitutions) between 'cat' and 'cut'?
3
0
1
2
Sign up free to see the answer and a step-by-step explanation.
What is the length of the longest strictly increasing subsequence of [10, 9, 2, 5, 3, 7, 101, 18]?
4
5
6
3
Sign up free to see the answer and a step-by-step explanation.
What is the largest sum of elements of [3, 2, 7, 10] if no two chosen elements may be next to each other?
17
12
13
10
Sign up free to see the answer and a step-by-step explanation.