Title: #1920 - Build Array from Permutation - LeetCode JavaScript Solutions
Open Graph Title: #1920 - Build Array from Permutation - LeetCode JavaScript Solutions
X Title: #1920 - Build Array from Permutation - LeetCode JavaScript Solutions
Description: Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < ...
Open Graph Description: Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < ...
X Description: Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < ...
Keywords:
Opengraph URL: https://leetcodejavascript.com/solutions/build-array-from-permutation
Domain: leetcodejavascript.com
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/build-array-from-permutation","name":"#1920 - Build Array from Permutation - LeetCode JavaScript Solutions","description":"Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < ...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar buildArray = function(nums) {\n return nums.map(n => nums[n]);\n};","keywords":"LeetCode 1920, #1920 - Build Array from Permutation, 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/build-array-from-permutation |
| 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/build-array-from-permutation/ |
| View on GitHub | https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/1920-build-array-from-permutation.js |
| Array | https://leetcodejavascript.com/tags/array |
| Simulation | https://leetcodejavascript.com/tags/simulation |
| Josh Crozier | https://joshcrozier.com |
Viewport: width=device-width,initial-scale=1
Robots: index, follow