We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bf7184 commit 54c3b96Copy full SHA for 54c3b96
hard/Orderly Queue.py
@@ -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