Grokking Dynamic Programming Patterns for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
'Minimum jumps with fee ' example two is wrong

Cockles

Mar 3, 2022

'Minimum jumps with fee ' example two is wrong

2

0

Comments
Comments
Design Gurus
Design Gurus4 years ago

How, can you elaborate?

The goal is to go beyond the final step, as mentioned in the problem statement:

Implement a method to calculate the minimum fee required to reach the top of the staircase (beyond the top-most step)

S
Shan 3 years ago

This isnt very clear from the prompt. Maybe add an example with a fee array of size 1 to clarify this.

J
jamesdsmith99 3 years ago

I agree that this is unclear.

S
singhursefamily 9 days ago

I would say that it seems like Example 2 is certainly wrong and Example 1 may or may not be wrong.

Scenario 1: Include the top step's fee in the calculation

Example 1:

[1, 2, 5, 2, 1, 2]. The total fee is 5 when going from step 0 (fee of 1) to step 3 (fee of 2)...