Exercises/#8 Rotate Array
#8

Rotate Array

MediumπŸ“¦ Arrays
70 XP

Problem

Given an integer array nums, rotate the array to the right by k steps in-place.

Examples

Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]

Input: nums = [-1,-100,3,99], k = 2
Output: [3,99,-1,-100]
arrayin-placereverse
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

8 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features