We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defhurdleRace(k,height):max_hurdle_height=max(height)#Findthemaximumheightamongthehurdles# Calculate the doses of potion needed to clear the hurdlesdoses_needed=max_hurdle_height-k# If doses_needed is less than or equal to zero, the character can already clear all hurdlesifdoses_needed<=0:return0else:returndoses_needed
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Hurdle Race
You are viewing a single comment's thread. Return to all comments →
Python 3 solution