알고리즘(CF)2017. 6. 17. 21:20

You are given an array of integers. On each move you are allowed to increase exactly one of its element by one. Find the minimal number of moves required to obtain a strictly increasing sequence from the input.




Example

For inputArray = [1, 1, 1], the output should be
arrayChange(inputArray) = 3.




Code

function arrayChange(inputArray) {

   

}

'알고리즘(CF)' 카테고리의 다른 글

19. areEquallyStrong  (1) 2017.06.18
18. palindromeRearranging  (1) 2017.06.17
16. areSimilar  (1) 2017.06.17
15. addBorder  (1) 2017.06.17
14. alternatingSums  (1) 2017.06.17
Posted by EL2A