Alwaldend
Docs
Light
Dark
Auto
Docs
Misc
Leetcode submissions
2026-01-10 12:31:07 +0300 MSK
2026-01-10 12:31:07 +0300 MSK
Reverse String Prefix
Tags:
Generated
Leetcode_submission
Links
https://leetcode.com/submissions/detail/1880559370/
Code
class
Solution
:
def
reversePrefix
(self, s: str, k: int)
->
str:
return
s[:k][::
-
1
]
+
s[k:]