Number of Recent Calls | Leet code 933 | Theory explained + Python code

Sdílet
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

Komentáře • 12

  • @Jasmine-ov5nq
    @Jasmine-ov5nq Před 6 měsíci +1

    This was the only video that really helped me!

  • @Cloud-577
    @Cloud-577 Před 3 lety +1

    thank you!! i had a hard time understanding the question

  • @ishayadav5221
    @ishayadav5221 Před 3 lety

    Amazing!! Love your videos!

  • @midhileshmomidi2434
    @midhileshmomidi2434 Před 3 lety +2

    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

    • @nands4410
      @nands4410 Před 3 lety

      With queue it's easier to do popleft. With list you have to slice.

    • @saianishmalla2646
      @saianishmalla2646  Před 3 lety +1

      Using a queue from collections you will have a look up time of O(1) vs O(n) for a list.

    • @nands4410
      @nands4410 Před 3 lety

      @@saianishmalla2646 Lookup time of O(1) for a queue??

    • @midhileshmomidi2434
      @midhileshmomidi2434 Před 3 lety

      @@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

    • @saianishmalla2646
      @saianishmalla2646  Před 3 lety +2

      I'm pretty sure yes. The popleft function is O(1) for sure while using pop(0) for a list would be O(N)