#3210

Find the Encrypted String

easy · 68.2% accepted · 112 likes · top 75%

string

Description

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

- For each character c in s, replace c with the kth character after c in the string (in a cyclic manner).

Return the encrypted string.

Solution