Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Frog Jump time complexity

//Frog jump is a time complexity issue where you get the number of steps
def solution(X, Y, D):
    number_of_steps = (Y-X)/D
    if number_of_steps.is_integer():
        return int(number_of_steps)
    return int(number_of_steps)+1

print(solution(1, 5, 2))
 
PREVIOUS NEXT
Tagged: #Frog #Jump #time #complexity
ADD COMMENT
Topic
Name
5+8 =