LRU cache leetcode | leetcode 146 | LRU cache leetcode python | leetcode coding challenge day 24

preview_player
Показать описание
Please like the video, this really motivates us to make more such videos and helps us to grow. thecodingworld is a community which is formed to help fellow student and professionals looking to crack the “coding interviews”.

We love solving and sharing problems which are frequently asked in technical interviews and voted by community at various websites.

✅ For more and upcoming updates join our community

#leetcode #python
Рекомендации по теме
Комментарии
Автор

On line 47, it should be self.hash[ key] = node

kentsang
Автор

Can we use list in python instead of DLL?

technotutors
Автор

this is not order o(1) since u used while loop

arnabpersonal
Автор

Thank you for the explanation! Can you please do other top interview questions from leetcode? Your explanations make it so much easier to understand.

Lerahul
Автор

Why do lines 25-30 in a while loop? Couldn’t you use an if statement?

kamariwright
Автор

line 47 - self.hash[hash] - why hash inside the bracket?

sbrahma
Автор

Could have explained more properly with the double linked list diagram, anyways good explanations overall

vaibhavkumar
Автор

I believe there are a few cases where this code may fail(I maybe wrong). In the get function how does your code deal with the scenario where node maybe the head of linked list. The head is not being updated and it may cause errors as node is moved to tailbut still stored as head.

ayushganguli
Автор

where is the code? nothing in description

karthikkumaresan
Автор

in line 12, why head of dll is (-1, -1) ?

TheArbaaz-rntq
Автор

Nice explanation, can you share at what device have you recorded the Video?

sudhirkumarshahu
Автор

Great Video!
Btw, what do you use to write on screen?

rahil_rehan
Автор

Hi,

I have a question here why didn't you used the orderedDict here?
Any specific reason?
If in interview you have just 45 mins and 2 problems to solve will you be able to complete it?

Also I have a question, if I use OrderedDict will it not solve the problem in O(1)? Is it not acceptable in interview?

Awaiting for your reply

taram
welcome to shbcf.ru