āš ļø Blockly failed to load. Check your internet connection and refresh.
Super Frog Jump
Problem
A super frog starts on platform 1 of N platforms. It can jump 1, 2, or 3 platforms forward. The cost is the absolute height difference.

Some platforms are broken (height = āˆ’1) — the frog cannot land on them!

Find the minimum total cost to reach platform N.
🧠 DP Concept
This extends Frog Jump with two new challenges:

1. Three jump options instead of two: check dp[iāˆ’1], dp[iāˆ’2], AND dp[iāˆ’3].
2. Broken platforms: if height[i] = āˆ’1, skip that platform (don't update dp[i]).

Also check that the source platform isn't broken and that iāˆ’j ≄ 1 before reading dp[iāˆ’j].

Recurrence: dp[i] = min over j∈{1,2,3} of (dp[iāˆ’j] + |h[i]āˆ’h[iāˆ’j]|), skipping broken sources.
Input Variables (pre-loaded)
šŸ’” Height āˆ’1 means broken (šŸ’€). Use if height ≠ āˆ’1 to skip broken platforms.
Your Output
Result
—
Run your program to see the result.
Execution Log
Ready. Press ā–¶ Run to start.
Expected Answer
Answer:
?
Hint