Error in the code

please check my error.

@Adhyayan,

Suggested Approach:

  1. Make a frequency map for each element in the first array i.e. store the frequency of each element in the first array.
  2. Iterate over the second array and search for current element in the freq map.
  3. If an entry is found , decrease its frequency in the freq map and push this element into your final answer array.
  4. Display the elements of this answer array after sorting it.

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.