Maximum Frequency Stack - Leetcode 895 - Python

preview_player
Показать описание


0:00 - Read the problem
1:40 - Drawing Explanation
9:06 - Coding Explanation

leetcode 895

#stack #interview #python
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

When you ever stuck in a problem just throw a hashmap 😄

coder
Автор

hey neetcode, just want to let you know that I got an offer from a FAANG company after months of rigorously going through problems and watching your vids to clear up confusion when I got stuck. Personally I found that your explanations are the best, you don't just talk code but you talk about the underlying concepts (and explaining them with clear drawings are a HUGE BONUS) which most of other youtubers kind of skip. I can't thank you enough, keep up the good work! Your work will help many people I am so sure of it. I still have another set of interview with another FAANG company, hopefully I'll whichever company I'll end up with will be the best choice. So you bet I will still grind your vids for the foreseeable future (and onwards of course). Cheers!

rahmaniastrid
Автор

Took about 1.5 months to walkthrough all your Coding Interview Solutions playlist. I really appreciate for all your works!

PegasusKr
Автор

Thanks Neetcode for making this problem simpler for me!

priyanshupriyam
Автор

You make me fall in love with Coding!
Many many thanks :)
Keep up the good work please ;p

suhailf
Автор

If I get a job in the It's 100 percent because of NeetCode! Thank you So much and Congratulations for 100k subscribers You deserve it because you have the best video explanations on the entire internet....btw this is probably the Easiest Hard problem I've ever seen

KishoreKumar-vexb
Автор

There are no words to tell how beautifully u put these videos so simple. Finally got a decent product job. I would love to watch neetcode even if I grow older ❤. Keep posting the videos

venkatasriharsha
Автор

Simplified a little bit :
import collections

class FreqStack:

def __init__(self):
self.count = {}
self.groups =

def push(self, val):
self.count[val] = self.count.get(val, 0) + 1


def pop(self):
result =
self.count[result] -= 1
if == []:

return result

SkyeTian
Автор

me as an unemployee year 3 day 25. amazing video. i wonder how long it will take a job at fang

masternobody
Автор

Man how do you keep up uploading these even while working at google. But good job keep up the good work, I'm still trying one day I may also pass the google interview.

hanklin
Автор

I always feel released when I got stuck in a problem but found out that you have posted a video solution on it. Thanks NeetCode!! Keep going!!!!

victoriac
Автор

Thanks a lot for such a great explanation. Love from India ♥

ChandraShekhar-bycd
Автор

This one idea of maintaining stack ( stack = valcnt : [1, 2, 3] ) saved me. Thanks great solution

consistentthoughts
Автор

there is something between this problem and a Young Tableux now that the final structure is revealed to be this stack of lists of decreasing heights.

Dezdichado
Автор

Dude !!! You are a leetcode GOD !!!! Fantastic visual explanation and code. Thanks !

vdyb
Автор

I like this one where you focus on the thought process to find the solution

hanklin
Автор

neetcode is like the rachel maddow of all tech best explainer

somakkamos
Автор

Wow, Now you're in the Daily Challenge. Thank you for great video

ChenAubrey
Автор

Enjoyable problem and nice explanation!

TheElementFive
Автор

Hello NeetCode, Thank you for your great work. I’m just curious about what software you are using for drawing explanations and screen recording because I need to make the same kind of videos for my friends.

MrSugar