Tap here to switch tabs
Problem
Submissions

Problem: Find the Encrypted String

med
30 min
Try to solve the Find the Encrypted String problem.

Statement

You are given a string s and an integer k. Encrypt the string using the following algorithm:

For each character at index i in s, replace it with the character located kk positions ahead in a cyclic order, wrapping around to the beginning of the string if the end is exceeded.

Return the encrypted string.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • 1≤1 \leq k ≤104\leq 10^4

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Encrypted String

med
30 min
Try to solve the Find the Encrypted String problem.

Statement

You are given a string s and an integer k. Encrypt the string using the following algorithm:

For each character at index i in s, replace it with the character located kk positions ahead in a cyclic order, wrapping around to the beginning of the string if the end is exceeded.

Return the encrypted string.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • 1≤1 \leq k ≤104\leq 10^4

  • s consists only of lowercase English letters.