Rotate Array
Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Do it in-place with O(1) extra space.
Rotate Array

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Do it in-place with O(1) extra space.

Example 1:
Input: {"nums":[1,2,3,4,5,6,7],"k":3}
Output: [5,6,7,1,2,3,4]
Input
arr ={"nums":[1,2,3,4,5,6,7],"k":3}

Rotate array to the right by 3 steps

k = 3

normalized k = 3

Array
1
0
2
1
3
2
4
3
5
4
6
5
7
6
Currently Reversing
Variables
No variables to display
DepthFunction Call
Stack empty
0/5