easyString 0 views

Find the Encrypted String

You are given a string s and an integer k.

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

Return the encrypted string.

Find the Encrypted String diagram

Example 1

Input: s = "dart", k = 3

Output: "tdar"

Example 2

Input: s = "aaa", k = 1

Output: "aaa"

Explanation: As all the characters are the same, the encrypted string will also be the same.

Constraints

  • 1 <= s.length <= 100
  • 1 <= k <= 10^4
  • s consists only of lowercase English letters.

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.