Python Frog Jmp
import math
def frog_jmp(x: int, y: int, d: int) -> int:
return math.ceil((y - x) / d)
This computes the jump count with math instead of simulation, which is the cleanest way to solve it.
import math
def frog_jmp(x: int, y: int, d: int) -> int:
return math.ceil((y - x) / d)
This computes the jump count with math instead of simulation, which is the cleanest way to solve it.