JavaScript Algorithm: The Hurdle Race

Max N
Level Up Coding
Published in
3 min readDec 31, 2019

--

For today’s algorithm, we will write a function called hurdleRace that will take in an integer k and an array height.

Imagine competing in a hurdle race and each hurdle is of varying heights. You have a maximum height that you can jump naturally. You take a magic potion that will help you increase your jump height by one for each dose. The purpose of this function is to see how many doses of the…

--

--

A writer that writes about JavaScript and Python to beginners. If you find my articles helpful, feel free to follow.