title: Python 3: Solving arrayChange in CodeFights
body: <p>I am currently working on the arrayChange level of Code Fights Arcade. This is the objective:
    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<br>
    moves required to obtain a strictly increasing sequence from the input.</p>
  
  <p>Example</p>
  
  <p>For <code>inputArray = [1, 1, 1]</code>, the output should be
    <code>arrayChange(inputArray) = 3</code>.</p>
  
  <p>I have written this code in Python 3:</p>
  
  <pre><code>def arrayChange(inputArray):
     original = inputArray[:]
     count = 0
     if len(set(inputArray)) == 1:
        return ((len(inputArray)-1)**2 + (len(inputArray)-1)) / 2
     elif sorted(inputArray) == inputArray:
        return 0
     for index, value in enumerate(inputArray):
        if index != len(inputArray) - 1 and value &gt; inputArray[index+1]:
           inputArray[index+1] += abs(inputArray[index+1] - value) + 1
        elif index != len(inputArray) - 1 and value == inputArray[index+1]:
           inputArray[index+1] += 1
        elif index == len(inputArray) - 1 and value &lt; inputArray[index-1]:
           inputArray[index] += inputArray[index-1] - value + 1
     print (inputArray)
     for index, value in enumerate(inputArray):
        count = count + abs(value - original[index])
     return count
  </code></pre>
  
  <p>It passes all the non-hidden tests but fails the 7th hidden test. Can someone please help me figure out what bug my code has? Thank you so much in advance!</p>