Menu
Coddy logo textTech

Rotate

Lesson 16 of 20 in Coddy's Beginner Challenges - Practice Basic Concepts course.

challenge icon

Challenge

Easy

Write a function named rotate that gets an array of integers and returns the array rotated to the right.

Examples,

  • rotate([1, 2, 3])  ->  [3, 1, 2]
  • rotate([3, 1, 2])  ->  [2, 3, 1]

Try it yourself

int* rotate(int* arr, int arrSize, int* returnSize) {
    // Write code here
}

All lessons in Beginner Challenges - Practice Basic Concepts