#2956

Find Common Elements Between Two Arrays

newbie · 155 · lc easy +14 · 84.4% accepted · 304 likes · top 96%

Description

Given integer arrays nums1 and nums2, compute two values:

- How many elements in nums1 also appear in nums2.

- How many elements in nums2 also appear in nums1.

Return these two counts as an array.

Code

1
2
3