← Questions

Order jumps between blocks to burn the most calories

0
AmazonCodingLast asked Sep 2025

You stand on the ground (height 0) next to n blocks of given heights. You must jump onto every block exactly once, in any order, and you never return to the ground. A jump from height a to height b burns (a - b)^2 calories, including the first jump from the ground. Return the most calories you can burn.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding