Description
Solutions
Submission
Frog Game 🐸

Given an array blocks where each cell represents the height of the current block, two frogs start on the same block. Each frog can only jump to another adjacent block if it is higher or equal to the one it is on. Return the maximum distance that can be between the two frogs if they can start together on any block.

Example 1:

Input:  blocks = [9,2,5,3,0]
Output: 2
Explanation:
Let the two frogs start on cell 4 and one of them go to cell 2. (There is another option here that will give you 2).

Example 2:

Input:  blocks = [1,2,3,4,5,8]
Output: 6
Explanation:
If both frogs start at cell 5.
Constraints:
    N/A
Thumbnail 0
Testcase

Result
Case 1

input:

output: