I had a coderpad interview with goldman sachs.
I had 2 exercises: one easy and one medium.
find the intersection elements in two arrays. Example:
Input: arr1: [1,1,2,2,2] arr2: [1,1,1,2,2,3,4,5]
Output: [1,1,2,2];
was exactly https://leetcode.com/problems/top-k-frequent-words/description/ , I applied the brute force of creating the hash, sort the hash and return the k elements.