Loading the task…
A runner faces a track of hurdles and can jump over anything up to their current limit. The function hurdle_race receives the jump height k and a list of hurdle heights height. Each potion dose increases the maximum jump by 1. Return the minimum number of doses needed to clear the tallest hurdle.
7, [2, 5, 4, 5, 2]04, [1, 6, 3, 5, 2]21, [1]0def hurdle_race(k: int, height: list[int]) -> int:
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.