What should be the approach to solve intersection problem using Hashing concept
How to apply hashing in intersection problem
@prateekad99,
You can use a Hashset. Put all elements of array 1 in a hashset. And search element wise for array 2 elements in the hashset.
Getting wrong output after applying hashset concept
@prateekad99,
https://ide.codingblocks.com/s/195725 I have edited your code. Kindly complete the intersection function. I have put all the elements from array 1 in a hashmap with their respective frequencies.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.