Title: #1528 - Shuffle String - LeetCode JavaScript Solutions
Open Graph Title: #1528 - Shuffle String - LeetCode JavaScript Solutions
X Title: #1528 - Shuffle String - LeetCode JavaScript Solutions
Description: You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith p...
Open Graph Description: You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith p...
X Description: You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith p...
Keywords:
Opengraph URL: https://leetcodejavascript.com/solutions/shuffle-string
Domain: leetcodejavascript.com
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/shuffle-string","name":"#1528 - Shuffle String - LeetCode JavaScript Solutions","description":"You are given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith p...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {string} s\n * @param {number[]} indices\n * @return {string}\n */\nvar restoreString = function(s, indices) {\n return indices.reduce((result, index, offset) => {\n result[index] = s[offset];\n return result;\n }, new Array(indices.length)).join('');\n};","keywords":"LeetCode 1528, #1528 - Shuffle String, Easy, JavaScript solution","learningResourceType":"Code","isAccessibleForFree":true,"educationalLevel":"intermediate","interactivityType":"mixed"}
| author | LeetCodeJavascript.com |
| og:type | article |
| og:image | https://leetcodejavascript.com/og-image.jpg |
| og:site_name | LeetCode JavaScript Solutions |
| twitter:card | summary_large_image |
| twitter:url | https://leetcodejavascript.com/solutions/shuffle-string |
| twitter:image | https://leetcodejavascript.com/og-image.jpg |
| twitter:creator | @joshcrozier |
| theme-color | #1f2937 |
Links:
| LeetCodeJavascript.com | https://leetcodejavascript.com/ |
| Star on GitHub | https://github.com/JoshCrozier/leetcode-javascript |
| Back to all solutions | https://leetcodejavascript.com |
| View on LeetCode | https://leetcode.com/problems/shuffle-string/ |
| View on GitHub | https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/1528-shuffle-string.js |
| Array | https://leetcodejavascript.com/tags/array |
| String | https://leetcodejavascript.com/tags/string |
| Josh Crozier | https://joshcrozier.com |
Viewport: width=device-width,initial-scale=1
Robots: index, follow