Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1e460f1

Browse files
python: add problem 189 and unittest
1 parent 19292ce commit 1e460f1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: UTF-8 -*-
2+
from typing import List
3+
4+
5+
class Solution_181_190(object):
6+
def rotate(self, nums: List[int], k: int) -> None:
7+
"""
8+
189
9+
:param nums:
10+
:param k:
11+
:return:
12+
"""
13+
k = k % len(nums)
14+
nums[:] = nums[-k:] + nums[:-k]

0 commit comments

Comments
 (0)