---
# System prepended metadata

title: '[1528. Shuffle String](https://leetcode.com/problems/shuffle-string/)'

---

# [1528. Shuffle String](https://leetcode.com/problems/shuffle-string/)
![](https://i.imgur.com/nfYidNk.png)
![](https://i.imgur.com/X4pyxtN.png)


char * restoreString(char * s, int* indices, int indicesSize)
{
    for(int i=0;i<indicesSize;i++)
    {
        for(int j=0;j<indicesSize;j++)
        {
            if(indices[j]==i)
            {
                char temp;
                temp=s[i];
                s[i]=s[j];
                s[j]=temp;
                int temp1;
                temp1=indices[i];
                indices[i]=indices[j];
                indices[j]=temp1;
            }
        }

    }
    return s;
}