Tap here to switch tabs
Problem
Submissions

Problem: Find Common Elements Between Two Arrays

med
30 min
Try to solve the Find Common Elements Between Two Arrays problem.

Statement

Given two integer arrays nums1 and nums2 of sizes n and m respectively, calculate two values:

  • The number of indices i such that nums1[i] occurs at least once in nums2.

  • The number of indices i such that nums2[i] occurs at least once in nums1.

Return an integer array answer of size 22 containing the two calculated values in that order.

Constraints:

  • n == nums1.length

  • m == nums2.length

  • 1≤1 \leq n, m ≤100\leq 100

  • 1≤1 \leq nums1[i], nums2[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find Common Elements Between Two Arrays

med
30 min
Try to solve the Find Common Elements Between Two Arrays problem.

Statement

Given two integer arrays nums1 and nums2 of sizes n and m respectively, calculate two values:

  • The number of indices i such that nums1[i] occurs at least once in nums2.

  • The number of indices i such that nums2[i] occurs at least once in nums1.

Return an integer array answer of size 22 containing the two calculated values in that order.

Constraints:

  • n == nums1.length

  • m == nums2.length

  • 1≤1 \leq n, m ≤100\leq 100

  • 1≤1 \leq nums1[i], nums2[i] ≤100\leq 100