Arrays: Left Rotation

  • + 2 comments

    instead of if-else statement temp[i] = a[(i+k)%n]; would be enough.

    Also this solution would take up extra memory(for temp).