in this video I have discussed frequency queries hackerrank solution from the hackerrank interview preparation kit.
Approach : first create two maps and in first map store the key value pair of element and its frequency and for second map you need to create a key value pair of frequency and and its occurance.
if you are someone who is trying to solve all the problems from hackerrank interview preparation kit playlist and getting stuck anywhere or looking for optimized solution do check my playlist
• Hackerrank Interview Preparation Kit
0:00 Start
0:50 Problem definition
1:41 Naive approach
6:11 logic building
6:21 How update/add works(first query)
11:45 How delete works (second query)
13:37 Third query
14:19 Complete example simulation
20:20 Writing code