#ProblemSolving #Python3 #HurdleRace
A video player plays a game in which the character competes in a hurdle race. Hurdles are of varying heights, and the characters have a maximum height they can jump. There is a magic potion they can take that will increase their maximum jump height by unit for each dose. How many doses of the potion must the character take to be able to jump all of the hurdles. If the character can already clear all of the hurdles, return
.Example
height = [1, 2, 3, 3, 2]
k = 1
The character can jump 1 unit high initially and must take 3- 1 = 2 doses of potion to be able to jump all of the hurdles.
Function Description
Create the hurdleRace function.
hurdleRace has the following parameter(s):
int k: the height the character can jump naturally
int height[n]: the heights of each hurdle
Returns
int: the minimum number of doses required, always 0 or more
Sample Input 0
5 4
1 6 3 5 2
Sample Output
2
Post your solution @PythonETHBot
Also you can submit your solution at #Hackerank
A video player plays a game in which the character competes in a hurdle race. Hurdles are of varying heights, and the characters have a maximum height they can jump. There is a magic potion they can take that will increase their maximum jump height by unit for each dose. How many doses of the potion must the character take to be able to jump all of the hurdles. If the character can already clear all of the hurdles, return
.Example
height = [1, 2, 3, 3, 2]
k = 1
The character can jump 1 unit high initially and must take 3- 1 = 2 doses of potion to be able to jump all of the hurdles.
Function Description
Create the hurdleRace function.
hurdleRace has the following parameter(s):
int k: the height the character can jump naturally
int height[n]: the heights of each hurdle
Returns
int: the minimum number of doses required, always 0 or more
Sample Input 0
5 4
1 6 3 5 2
Sample Output
2
Post your solution @PythonETHBot
Also you can submit your solution at #Hackerank
“Python 3.9.0 is the newest feature release of the #python3 language” that comes with numerous features, and optimizations.
Do you know how to remove prefix or suffix from a String in Python?
Watch "Two String Functions You Must Know in Python 3.9.0" on YouTube
https://youtu.be/u1OH6nZdmw4
Watch "Two String Functions You Must Know in Python 3.9.0" on YouTube
https://youtu.be/u1OH6nZdmw4
YouTube
Two String Functions You Must Know in Python 3.9.0
Hey, everyone, and welcomes to this video. In this video, You going to learn about the two important features of string functions which was introduced in the Python 3.9.0 version.
#python3.9.0 #pythontutorial #pythonfunction
Thanks for watching!
#python3.9.0 #pythontutorial #pythonfunction
Thanks for watching!
👍4
#QuestionForGroup
Do you know how to remove prefix or suffix from a String in Python?
Check out it
https://youtu.be/u1OH6nZdmw4
#python
Do you know how to remove prefix or suffix from a String in Python?
Check out it
https://youtu.be/u1OH6nZdmw4
#python
YouTube
Two String Functions You Must Know in Python 3.9.0
Hey, everyone, and welcomes to this video. In this video, You going to learn about the two important features of string functions which was introduced in the Python 3.9.0 version.
#python3.9.0 #pythontutorial #pythonfunction
Thanks for watching!
#python3.9.0 #pythontutorial #pythonfunction
Thanks for watching!
👍2