MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / restoreString

Method restoreString

ShuffleString.java:2–10  ·  view source on GitHub ↗
(String s, int[] indices)

Source from the content-addressed store, hash-verified

1class Solution {
2 public String restoreString(String s, int[] indices) {
3 char arr[] = new char[s.length()];
4 for(int i=0;i<s.length();i++)
5 {
6 arr[indices[i]] = s.charAt(i);
7 }
8 String res = String.valueOf(arr);
9 return res;
10 }
11}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected