A frog starts on stair 0 and wants to reach the last stair. From stair i it can jump to i+1 or i+2, paying a cost equal to the absolute height difference between the stairs. Given the heights array, return the minimum total cost to reach the last stair. The input is JSON {heights}.
Input: JSON {heights}.
Output: Integer — the minimum total cost.
Input: {"heights":[30,10,60,10,60,50]}
Output: 40
Explanation: An optimal jump sequence costs 40.Input: {"heights":[10]}
Output: 0
Explanation: Already at the last stair.Input: {"heights":[10,30,40,20]}
Output: 30
Explanation: Optimal path cost.1<=n<=10^50<=height<=10^4