← 返回 meta 的题目列表Minimize Additions for Harmonious Structures
类型:online_judge
Given a series of heights for structures [5,7,9,4,11], you need to make the structures harmonious, meaning the difference in height between adjacent structures is only one. You can only increase the height of the structures. They can be in ascending or descending order. Return the minimum total height that needs to be added.
Example
Input
[5,7,9,4,11]