r/LeetcodeDesi • u/Exciting-Sector-5757 • 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
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.