Skip to content

Commit 54c3b96

Browse files
authored
Create Orderly Queue.py
1 parent 5bf7184 commit 54c3b96

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hard/Orderly Queue.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#Orderly Queue
2+
class Solution:
3+
def orderlyQueue(self, S: str, K: int) -> str:
4+
return ''.join(sorted(S)) if K > 1 else min(S[i:] + S[:i] for i in range(len(S)))

0 commit comments

Comments
 (0)