【leetcode】重新排列字符串

 

char * restoreString(char * s, int* indices, int indicesSize){
    char* RetStr = (char*)calloc(indicesSize+1, sizeof(char));
    for (int i = 0; i < indicesSize; i++)RetStr[indices[i]] = s[i];
    return RetStr;
}

 

posted @ 2020-09-05 19:58  温暖了寂寞  阅读(309)  评论(0编辑  收藏  举报