text: /**
   * @param {string} s
   * @param {number[]} indices
   * @return {string}
   */
  const restoreString = function (s, indices) {
    const res = [...s.split('')]
    for (let i = 0; i < s.length; i++) {
      const idx = indices[i]
      res[idx] = s[i]
      res[i] = res[idx]
    }
    return res.join('')
  }
  
  console.log(restoreString('codeleet', [4, 5, 6, 7, 0, 2, 1, 3]))
  