Skip to content

Commit 4c65818

Browse files
feat: solve Striver SDE Sheet problem 343 - Intersection of Two Arrays II
1 parent e3eed2e commit 4c65818

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Intersection of Two Arrays II (Easy)
2+
3+
**Problem ID:** 350
4+
**Problem Number:** 343
5+
**Link:** https://leetcode.com/problems/intersection-of-two-arrays-ii
6+
7+
## Problem Statement
8+
9+
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
10+
11+
 
12+
Example 1:
13+
14+
15+
Input: nums1 = [1,2,2,1], nums2 = [2,2]
16+
Output: [2,2]
17+
18+
19+
Example 2:
20+
21+
22+
Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
23+
Output: [4,9]
24+
Explanation: [9,4] is also accepted.
25+
26+
27+
 
28+
Constraints:
29+
30+
31+
1 <= nums1.length, nums2.length <= 1000
32+
0 <= nums1[i], nums2[i] <= 1000
33+
...
34+
35+
## Solutions
36+
37+
- Python: `solution.py`
38+
- Java: `solution.java`
39+
- JavaScript: `solution.js`
40+
41+
**Note:** Solutions need to be implemented.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Solution for Intersection of Two Arrays II
2+
// Problem ID: 350
3+
// Link: https://leetcode.com/problems/intersection-of-two-arrays-ii
4+
5+
class Solution {
6+
// TODO: Implement solution
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Solution for Intersection of Two Arrays II
2+
// Problem ID: 350
3+
// Link: https://leetcode.com/problems/intersection-of-two-arrays-ii
4+
5+
/**
6+
* TODO: Implement solution
7+
*/
8+
var solve = function() {
9+
// Implementation needed
10+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Solution for Intersection of Two Arrays II
2+
# Problem ID: 350
3+
# Link: https://leetcode.com/problems/intersection-of-two-arrays-ii
4+
5+
class Solution:
6+
def solve(self):
7+
# TODO: Implement solution
8+
pass

0 commit comments

Comments
 (0)