Number of Recent Calls | Leet code 933 | Theory explained + Python code
Vložit
- čas přidán 27. 07. 2024
- This video is a solution to Leet code 933, Number of Recent Calls. I explain the question, go over how the logic / theory behind solving the question and finally solve it using Python code.
Comment below if you have a better solution to this problem!
Let me know if you have any feedback and don't forget to subscribe for more videos!
Code: leetcode.com/problems/number-...)
More leetcode questions solved:
• Add and Search Word - ...
Timestamps:
0:00 Question Explained
5:31 Python Code
Gear used:
Mic: amzn.to/3awi3b6
Drawing pad: amzn.to/2O7PaaU
This was the only video that really helped me!
thank you!! i had a hard time understanding the question
Amazing!! Love your videos!
Thank you so much!
Hi bro,
One doubt !!
I have taken list instead of queue
What is the difference here and when I go through discussion forum many had taken queue
With queue it's easier to do popleft. With list you have to slice.
Using a queue from collections you will have a look up time of O(1) vs O(n) for a list.
@@saianishmalla2646 Lookup time of O(1) for a queue??
@@saianishmalla2646 Oh!! That's a very important info thank you
Then in that case whenever we need to use huge arrays we can take a queue right
I'm pretty sure yes. The popleft function is O(1) for sure while using pop(0) for a list would be O(N)