Tap here to switch tabs
Problem
Submissions

Problem: Shuffle String

med
30 min
Try to solve the Shuffle String problem.

Statement

You are given a string s and an integer array indices of the same length nn.

The string s will be rearranged such that the character at index ii is placed at position indices[i] in the resulting string.

Return the shuffled string.

Constraints:

  • s.length ==== indices.length ==n== n

  • 1≤n≤1001 \leq n \leq 100

  • s consists of only lowercase English letters.

  • 0≤0 \leq indices[i] <n< n

  • All values of indices are unique.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Shuffle String

med
30 min
Try to solve the Shuffle String problem.

Statement

You are given a string s and an integer array indices of the same length nn.

The string s will be rearranged such that the character at index ii is placed at position indices[i] in the resulting string.

Return the shuffled string.

Constraints:

  • s.length ==== indices.length ==n== n

  • 1≤n≤1001 \leq n \leq 100

  • s consists of only lowercase English letters.

  • 0≤0 \leq indices[i] <n< n

  • All values of indices are unique.