Check if There is a Valid Partition For The Array - Leetcode 2369 - Python

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 23

  • @amanaryan7271
    @amanaryan7271 Před rokem +5

    Excellent explanation!!!! Keep uploading daily leetcode problems and if possible weekly and biweekly contests too. It'll be very much helpful!!!!

  • @Hi-qh2en
    @Hi-qh2en Před rokem +6

    It would be great if you could explain some of the Q4’s on the weekly/biweekly contests. I can never usually solve them but I can (usually) solve the average hard question.

  • @purna4815
    @purna4815 Před rokem +2

    Hi, sir, this is Purna from India, I always watch your videos for the problem-solving,
    "Wow, this video is an absolute gem! The way it breaks down the complex problem into easy-to-understand segments is truly impressive. The visuals are captivating, and the narration is clear and engaging. I learned so much from watching this - it's evident that a lot of effort and research went into creating such a valuable solution. This is definitely going into my 'favorites' playlist, and I can't wait to share it with my friends. Keep up the fantastic work!"

  • @massimomonticelli6010

    Hey NeetCode! How are you doing?
    In the top-down implementation, we can make an optimisation: if the first dfs returns true, there is no need to run the second one. So in line 13, I would add this condition:
    if !res and i < len(nums) - 2:
    Also, we can change line 16 to res = dfs(i + 3), as we already know res has been set to false, if we are going to execute this expression.
    Thanks for your amazing video!
    Massimo.

  • @ShivendraSingh9935
    @ShivendraSingh9935 Před rokem

    That's a really nice explanation, I checked 3 different explanation for bottom up but yours is very simple and intuitive!

  • @chaopeter9690
    @chaopeter9690 Před rokem +3

    Today completed by myself haha, no need to watch your video😁

  • @kareemadesola6522
    @kareemadesola6522 Před rokem

    Awesome to see both bottom-up and top-down approaches. Keep it up

  • @rumonintokyo
    @rumonintokyo Před rokem

    didnt really understand the dp caching thing part... do you have any other video that explains caching better ?

  • @mohakparekh8671
    @mohakparekh8671 Před 11 měsíci

    Can someone tell me why are we not returning true when we find one valid partition. Like in [4, ,4, ,4, 5, 6] we have [4, ,4] as valid partition but still we go and check for the partition [4, ,5, 6]. Why is this needed?

  • @uptwist2260
    @uptwist2260 Před rokem +1

    thanks for the daily

  • @parashararamesh4252
    @parashararamesh4252 Před rokem

    Ever considered using manim for animations? Might look prettier and like 3b1b

  • @user-nx6wn4xc9y
    @user-nx6wn4xc9y Před rokem

    Thanks for sharing such a excellent video!!

  • @yang5843
    @yang5843 Před rokem

    Do you use your Microsoft surface to draw on during interviews?

  • @VidyaBhandary
    @VidyaBhandary Před rokem

    Wow ... You are the king dude !!!!!

  • @ErtjonMecka
    @ErtjonMecka Před rokem

    I wonder how the solution would change is we have to check the string in a circular way. e.g. 74456

  • @user-bt3hd6zi5y
    @user-bt3hd6zi5y Před rokem

    SUPER CLEAR!!

  • @satyabharadwaj7779
    @satyabharadwaj7779 Před rokem

    I could solve it the brute force but it fails with time limit. Can someone explain how caching works here?

  • @ultrasourus9715
    @ultrasourus9715 Před 4 měsíci

  • @phpostrich
    @phpostrich Před 11 měsíci

    The bottom up dp part of the video, I could not follow

  • @jessanraj9086
    @jessanraj9086 Před rokem

    Awesome video

  • @graceiscoding
    @graceiscoding Před rokem

    Where did you go?

  • @NguyenLe-pu6mr
    @NguyenLe-pu6mr Před rokem

    let's gooooo

  • @Arthurgarzajr
    @Arthurgarzajr Před rokem

    First!