Maximum Sum of 3 Non-Overlapping Subarrays - Leetcode 689 - Python

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 50

  • @JamesBond-mq7pd
    @JamesBond-mq7pd День назад +28

    I studied the problem. I will try to solve it again in 6 hours.

  • @gauravdeep2350
    @gauravdeep2350 17 часов назад +4

    Made a smiley face 5:19

  • @Sanjay-xq5xr
    @Sanjay-xq5xr 20 часов назад +2

    Excellent explanation 🎉, Keep doing this

  • @shashwatsingh9247
    @shashwatsingh9247 21 час назад +2

    The while loop was the best, figured out the main dp function but couldn't understand how to cache the indices.

  • @ashwinashok1998
    @ashwinashok1998 День назад +2

    Very well explained. Thanks!

  • @astroversace466
    @astroversace466 20 часов назад +3

    what is the medium problem that he is referring to?

    • @arjunsuresh9010
      @arjunsuresh9010 15 часов назад +1

      finding max sum given the array and sub array count = k

  • @tejas1531
    @tejas1531 17 часов назад +1

    That was so amazing thanks for the solution.

  • @leetprep
    @leetprep 13 часов назад

    For the code at 7:00, why do we need this "or i >= len(nums) - 1"

    • @SARABRIKI-g5p
      @SARABRIKI-g5p 12 часов назад

      you're asking why is it 1 and not k like in the final code?

  • @drain1635
    @drain1635 День назад +4

    What lc medium is he referring to

    • @l1f3study74
      @l1f3study74 День назад +1

      target sum ig

    • @cosmicheathen1955
      @cosmicheathen1955 20 часов назад

      instead of indices we have to just return the max sum of 3 non-overlapping sub-arrays that's what he's referring to medium

  • @ceciljoel9577
    @ceciljoel9577 18 часов назад +1

    How much time it took for neatcode to first solve this problem?

  • @ahmedtremo
    @ahmedtremo 23 часа назад +1

    Great video thanks

  • @Avi_Bedi2125
    @Avi_Bedi2125 22 часа назад +1

    can u please tell the question number of the leetcode medium u were talking?

    • @NeetCodeIO
      @NeetCodeIO  19 часов назад +1

      I don't think it's actually a LC medium, but it's practically the same as target sum. I just meant implementing that function is a medium difficulty problem.

  • @yahyamohamoud7290
    @yahyamohamoud7290 День назад +2

    can you add a feature to reset course progress so i cant see my old solutions

    • @Axel.Blazer
      @Axel.Blazer 17 часов назад

      [havent purchased his course n not sure]
      ig the way coding websites work is that they store your last {same browser} written code as is locally..in sessionStorage or something..maybe reset cache/cookies n login again.. IDK if this will fix this but it should since most coding websites function this way

    • @Frustrated-Indian-2024
      @Frustrated-Indian-2024 15 часов назад

      @@Axel.Blazer won't work in case of cloud storage which might be the case as the website won't be having many users. I most probably be wrong.

    • @Axel.Blazer
      @Axel.Blazer 15 часов назад +1

      @@Frustrated-Indian-2024 only one way to find out haha =)

  • @uppubhai
    @uppubhai День назад

    What software you use in mac to draw all these ?

  • @stark3.148
    @stark3.148 День назад

    We can do this with Sliding window, with O(1) space complexity and O(n+k) time complexity
    It is also there in Editorial solutions

  • @yhbarve
    @yhbarve День назад +1

    You know what that is? Simply lovely! I'll tell you that.

    • @4chan-i6w
      @4chan-i6w День назад

      tutu tu tu max verstappen

    • @4chan-i6w
      @4chan-i6w День назад

      three month break getting to you

  • @pastori2672
    @pastori2672 День назад

    polished brute force am just playing good video

  • @atulgupta1319
    @atulgupta1319 14 часов назад

    "Nothing too crazy" Are you kidding me?

  • @buckwheatplate8770
    @buckwheatplate8770 21 час назад

    I'm going to cache that video in my watch later playlist

  • @chaitanyayeole4111
    @chaitanyayeole4111 15 часов назад

    Can you make a vide on Leetcode #1001? It is a Hard question.

  • @kushagrabansal2107
    @kushagrabansal2107 17 часов назад

    How are you seeing the old UI?!! It's disabled now for most I guess

  • @thebearguym
    @thebearguym 17 часов назад

    problems like these make me feel dumb and makes lc more fun

  • @fraserdab
    @fraserdab 21 час назад +1

    contest hards are on other level tho💀

  • @rishavkumar7133
    @rishavkumar7133 День назад +2

    man pyhton is slow ass language same code runs in 3ms in java

    • @rahulsiddhardh3701
      @rahulsiddhardh3701 День назад +1

      it runs 0ms in cpp. every language has it's pros and cons

    • @krithinragav9811
      @krithinragav9811 День назад +2

      doesnt matter for dsa, tc and sc is what matters here

    • @kaluginpeter
      @kaluginpeter День назад

      It's incorrect to think that way. Likewise, check how many time will be spend to solve the problem on a Rust, or Fortran or even Assembler?
      Does it mens, that you shouldn't learn Java?
      Programming languages is just a tool, thats help to build software applications and etc. There is not the best one. One tool can be good at problem, meanwhile for another problem not. It's just a case. You can try to write ML or Data science on a java instead of python and you understand the general idea.

    • @rishavkumar7133
      @rishavkumar7133 20 часов назад

      @@kaluginpeter Yeah but I was just pointing out to an obvious fact. Meanwhile, do you know that most of the ML and Data Science libraries are coded in c or some other faster languages but their APIs are ported to Python so that even people in industry like scientists can directly use those libraries without going into rabbit hole of language which just goes onto prove what I said, it's trash when it comes to speed?

    • @kaluginpeter
      @kaluginpeter 20 часов назад

      @@rishavkumar7133 it's not a trash, but if it was so straightforward, why scientists use python for ml instead of rare C or Fortran? Every language good for problem in their area. At least on every on-site section write algo on python much cleaner then on other languages.

  • @DJ-pn9te
    @DJ-pn9te 18 часов назад

    just a waste of time.... what is the application for this?

    • @fraserdab
      @fraserdab 17 часов назад

      Lol why are u here then

  • @Suspiciousguy124
    @Suspiciousguy124 День назад +2

    Bro, Can you react to the skilled immigration taking the job, or are they worth importing? I know you are American and a second-generation Indian, but it would be cool to hear your take on this.

    • @NeetCodeIO
      @NeetCodeIO  День назад +9

      i guess i might, but i'm still contemplating if it's worth the brain cells i would lose trying to comprehend the stupidity i've seen on twitter, from both sides tbh

    • @Kingkillwatts
      @Kingkillwatts День назад +2

      Concerned as well, but we can only do what’s in our power to influence our odds of being hired. No sense in worrying about anything outside of that really.

    • @baetz2
      @baetz2 День назад +4

      As a skilled immigrant who is now trying his best to take your IT job (sorry), I can say 2 things: First, I have impression that education in the US kinda sucks, at least elementary schools. Kids just have fun, no challenges, no homework. So it's in the best interest of the US to import foreign brains. Second, as an English learner, I must mention that 'chosen' has only 1 'o' at 6:02 (sorry again).

    • @PreethuRajRoy
      @PreethuRajRoy 14 часов назад

      @@baetz2 Bruh, what do you expect from kids in elementary school? grind LC? They should be having fun at that age.

    • @heybeachMIN
      @heybeachMIN 12 часов назад

      Can someone fill me in on the context of this topic? I've heard that Elon Musk wants to simplify the hiring of Indians, does that bother you?
      I'm just not american, so no idea)