Title: #3046 - Split the Array - LeetCode JavaScript Solutions
Open Graph Title: #3046 - Split the Array - LeetCode JavaScript Solutions
X Title: #3046 - Split the Array - LeetCode JavaScript Solutions
Description: You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that: nums1.length == n...
Open Graph Description: You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that: nums1.length == n...
X Description: You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that: nums1.length == n...
Keywords:
Opengraph URL: https://leetcodejavascript.com/solutions/split-the-array
Domain: leetcodejavascript.com
{"@context":"https://schema.org","@type":"Code","url":"https://leetcodejavascript.com/solutions/split-the-array","name":"#3046 - Split the Array - LeetCode JavaScript Solutions","description":"You are given an integer array nums of even length. You have to split the array into two parts nums1 and nums2 such that: nums1.length == n...","programmingLanguage":"JavaScript","codeRepository":"https://github.com/JoshCrozier/leetcode-javascript","codeSampleType":"JavaScript","text":"/**\n * @param {number[]} nums\n * @return {boolean}\n */\nvar isPossibleToSplit = function(nums) {\n const map = new Map();\n\n for (const num of nums) {\n map.set(num, (map.get(num) || 0) + 1);\n if (map.get(num) > 2) return false;\n }\n\n return true;\n};","keywords":"LeetCode 3046, #3046 - Split the Array, 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/split-the-array |
| 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/split-the-array/ |
| View on GitHub | https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/3046-split-the-array.js |
| Array | https://leetcodejavascript.com/tags/array |
| Hash Table | https://leetcodejavascript.com/tags/hash-table |
| Counting | https://leetcodejavascript.com/tags/counting |
| Josh Crozier | https://joshcrozier.com |
Viewport: width=device-width,initial-scale=1
Robots: index, follow