350. Intersection of Two Arrays II | hashing | leetcode daily challenge | DSA | Hindi
HTML-код
- Опубликовано: 22 авг 2024
- Problem Name:
350. Intersection of Two Arrays II
Problem Statement:
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.
Problem link:
leetcode.com/p...
Java Plus DSA Placement Course Playlist:
• Java and DSA Course Pl...
Java Plus DSA Sheet:
docs.google.co...
Notes:
github.com/Tiw...
Telegram Link:
shashwattiwari...
Ultimate Recursion Series Playlist:
• Recursion and Backtrac...
Instagram Handle: (@shashwat_tiwari_st)
shashwattiwari...
Samsung Interview Experience:
• I cracked Samsung | SR...
Company Tags:
Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung
Timestamp:
0:00 - Introduction
#ShashwatTiwari #coding #problemsolving
Best ever..move ahead sir complete full java along with advance...because no one is providing java playlist...everyone go towards c++
Thanks 😊
maine aapse pehle seekha tha intersection of two arrays 1 toh mujhse aaj ka khud hi ban gya tha bhaiya😍
Good Explanation 👏🏻
class Solution {
public:
vector intersect(vector& nums1, vector& nums2) {
int arr[1001] = {0};
vectorans;
for(int a:nums1) arr[a]++;
for(int b:nums2)
{
if(arr[b]>0)
{
ans.push_back(b);
arr[b]--;
}
}
return ans;
}
};
time O(n) space O(1)
bhai please apni DSA wali series continue kro na...