Posted on

Description

Submission

class Solution {
public:
    string restoreString(string s, vector<int>& indices) {
        int l = s.length();
        string ret = s;
        
        for(int i = 0; i < l; ++i) {
            ret[indices[i]] = s[i];
        }
        
        return ret;
    }
};

Leave a Reply

Your email address will not be published. Required fields are marked *