P*b
1 楼
这里牛人多
You are given an array of positive integers. Convert it to a sorted array wi
th minimum cost. Only valid operation are
1) Decrement -> cost = 1
2) Delete an element completely from the array -> cost = value of element
For example:
4,3,5,6, -> cost 1
10,3,11,12 -> cost 3
代码总写不好
You are given an array of positive integers. Convert it to a sorted array wi
th minimum cost. Only valid operation are
1) Decrement -> cost = 1
2) Delete an element completely from the array -> cost = value of element
For example:
4,3,5,6, -> cost 1
10,3,11,12 -> cost 3
代码总写不好