MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / Solution

Class Solution

Python/rotate-array.py:1–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Solution:
2 def rotate(self, nums: List[int], k: int) -> None:
3 """
4 Do not return anything, modify nums in-place instead.
5 """
6 lenz = len(nums)
7 k = k % lenz
8 if k == 0:
9 return nums
10 nums += nums[:-k]
11 del nums[:lenz-k]
12

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected