2025-08-22 18:16:52 +0000 UTC

Find the Encrypted String

Code

class Solution:
    def getEncryptedString(self, s: str, k: int) -> str:
        res = []
        for i in range(len(s)):
            res.append(s[(i + k) % len(s)])
        return "".join(res)