Skip to content

Commit 0541351

Browse files
authored
Create 3210. Find the Encrypted String.py
1 parent 907f0c2 commit 0541351

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
3+
'''
4+
1. 아이디어 :
5+
-
6+
7+
2. 시간복잡도 :
8+
O(n)
9+
10+
3. 자료구조/알고리즘 :
11+
-
12+
13+
'''
14+
class Solution:
15+
def getEncryptedString(self, s: str, k: int) -> str:
16+
n = len(s)
17+
k = k%n
18+
ans = ""
19+
for i in range(n):
20+
ans+=s[(k+i)%n]
21+
return ans

0 commit comments

Comments
 (0)