Practice Frog Jump II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a 0-indexed integer array stones sorted in strictly increasing order representing the positions of stones in a river. A frog, initially on the first stone, wants to travel to the last stone and then return to the first stone. However, it can jump to any stone at most once. The length of a jump is the absolute difference between the position of the stone the frog is currently on and the position of the stone to which the frog jumps. The cost of a path is the maximum length of a jump among all jumps in the path. Return the minimum cost of a path for the frog.
Source: Frog Jump II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
stones = [0,2,5,6,7]
5
# Example 2
stones = [0,3,9]
9
Constraints
Related LeetCode Problems
Practice more problems similar to Frog Jump II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.