Practice Find the Encrypted String
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given s and k, build a new string whose character at index i is the original character at index (i + k) modulo s.length. All replacements use the original string and wrap around cyclically. Return the encrypted string.
Source: Find the Encrypted String on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
s = "dart", k = 3
Output
"tdar"
# Example 2
Input
s = "aaa", k = 1
Output
"aaa"
Constraints
1 <= s.length <= 100
1 <= k <= 10^4
s consists only of lowercase English letters.
Related LeetCode Problems
Practice more problems similar to Find the Encrypted String.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.