📘 reduce() + includes()
 # Intuition  \n\n\n\n\n\n# Complexity\n- Time complexity: O(n^2)\n\n\n- Space complexity: O(1)\n\n\n# Code\n\n/**\n * @param {number[]} nums1\n * @param {numbe
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number[]} nums1\n * @param {number[]} nums2\n * @return {number[]}\n */\nvar findIntersectionValues = function (nums1, nums2) {\n  const value1 = nums1.reduce((sum, value) => nums2.includes(value) ? ++sum : sum, 0);\n  const value2 = nums2.reduce((sum, value) => nums1.includes(value) ? ++sum : sum, 0);\n  return [value1, value2];\n}\n```
['JavaScript']