title: i cant insert temp element in the end of array rotation
body: <pre><code>def temprotate(arr, d, n):
      temp = []
      for i in range(d):
          temp.append(arr[i])
  
      # Function to shift arr by 2
      for i in range(n - d):
          arr[i] = arr[i + d]
  
      # Function to reinsert temp elements
      for i in range(d):
          a = temp[i]
          for i in range(1, d + 1):
              arr.insert(arr[n - i], a)
  
  
  def printarr(arr, size):
      for i in range(size):
          print(arr[i], end=' ')
  
  
  arr = [1, 2, 3, 4, 5, 6, 7]
  temprotate(arr, 2, 7)
  printarr(arr, 7)
  </code></pre>
  <p>result =
  3 2 4 5 6 7 6</p>
  <p>i dont know what is wrong is the insert code section!</p>
  <p>the insert function seems like to add elements to the list when i want it to replace elements from the list with other elements in the temp.</p>