Shuffle String
July 27, 2020
Shuffle String
class Solution {
public String restoreString(String s, int[] indices) {
char[] resultArr = new char[indices.length];
for(int i=0; i<indices.length; i++){
resultArr[indices[i]] = s.charAt(i);
}
return String.valueOf(resultArr);
}
}