Rotate Array

Given an integer array nums and a non-negative integer k, rotate the array to the right by k steps, in place. Implementations modify nums directly and return it; the returned value is the result.

A right rotation by k moves the last k elements to the front while the first n - k elements shift to the back, preserving their relative order. Steps are counted with k % n, so k may be larger than the array length.

Examples
Input: [[1,2,3,4,5,6,7],3]
Output: [5,6,7,1,2,3,4]
Hints

Rotate Array

Given an integer array `nums` and a non-negative integer `k`, rotate the array to the right by `k` steps, in place. Implementations modify `nums` directly and return it; the returned value is the result.