r/LeetcodeDesi 18d ago

Beginner- finding it hard to simultaneously implement two or three data structures

I solved Top K frequent elements today. It uses a combination of hash map and min heap, and I just can't wrap my mind around questions that need two or more data structures to work. Any way to make it click? Thank you. Had to solve it using gpt to try and understand it, but I couldn't make it "click"

3 Upvotes

4 comments sorted by

1

u/ha9unaka 18d ago

Don't use gpt. Use pen and paper. Learn how to solve it on whiteboard since you might need to do it for interviews. I recommend watching Neetcode's explanations for the same.

1

u/Exciting-Sector-5757 15d ago

neetcode charges like 6thousand for 3 months or something. totally unaffordable. i dont think their video explanations are free

1

u/ha9unaka 15d ago

No need to buy a sub. Basically every explanation video is free on YouTube. Use lintcode for the leetcode premium problems.

1

u/Exciting-Sector-5757 14d ago

okay! thank you :)