Rotate Array

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

Constraints

  • 1 <= nums.length <= 100000
  • -2147483648 <= nums[i] <= 2147483647
  • 0 <= k <= 100000
Saving… · 2 lines
class Solution:
def rotateArray(self, nums: List[int], k: int) -> None:
Console

Click Run to execute sample tests.