CodeChef Matrix Rotation
You don't need all that copying and rearranging, all you need is to keep a pointer to where array starts and adjust your index calculation based on that. 
Suppose you have an array of integers: [0, 1, 2, 3, 4], current start index is 0. If you rotate 2 to the left, your start index becomes 3: [2, 3, 4, 0, 1]. If you rotate this to the right 4 times, your start index is changed to 2. 
You can see a pattern here: moving n cells to the left decreases start index by n and moving right increases start index.

Here's a sample pseudo-code:

startIndex = 0;
foreach operation 
   if operation is print
      transformedIndex = operation.index - startIndex
      if(transformedIndex &lt; 0)
         transformedIndex += inputArray.length
      print inputArray[transformedIndex]   

   else
      if operation is rotate left
         startIndex -= operation.index
      else
         startIndex += operation.index
      startIndex = startIndex mod inputArray.length
      if startIndex &lt; 0
         startIndex += input.Length