/**
* @param {number[]} nums
* @param {number} k
* @return {void} Do not return anything, modify nums in-place instead.
*/
var rotate = function(nums, k) {
if(k > nums.length)
k = k - nums.length;
nums.unshift(...nums.splice(nums.length - k, k))
return nums
};
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)