Add Strings

Sdílet
Vložit
  • čas přidán 2. 07. 2024
  • For business inquiries email partnerships@k2.codes MUSIC
    ----------------------------------------------------------------------------------------------------------------
    Off the balm+ by Lo-Kage
    / balm
  • Věda a technologie

Komentáře • 60

  • @KevinNaughtonJr
    @KevinNaughtonJr  Před 4 lety +3

    instagram: instagram.com/kevinnaughtonjr/
    twitter: twitter.com/kevinnaughtonjr

    • @Homelander007
      @Homelander007 Před 4 lety

      1268. Search Suggestions System and 1192. Critical Connections in a Network ?
      can you help with this ?

    • @giovannianthony1675
      @giovannianthony1675 Před 2 lety

      Instablaster.

  • @alanwilliams9363
    @alanwilliams9363 Před 4 lety +33

    Thanks for the videos Kevin, the helped me land an internship at Adobe in NYC.

    • @KevinNaughtonJr
      @KevinNaughtonJr  Před 4 lety +14

      NO WAY ALAN CONGRATS I'M SO HAPPY FOR YOU!!!!! :)))))

  • @caseyho5910
    @caseyho5910 Před 4 lety +3

    yessss coding interview question is back. thanks for recording as always

  • @quirkyquester
    @quirkyquester Před 3 lety

    amazing video bro! I love it!

  • @thinker-o5p
    @thinker-o5p Před 2 lety

    simple and clean solution

  • @codingbanda6189
    @codingbanda6189 Před 3 lety

    Great one Bro..
    And Hearty Congratulations on getting into Google

  • @mashak3765
    @mashak3765 Před 3 lety

    thank you soo much for your tutorials - super helpful!

  • @poojaguru2516
    @poojaguru2516 Před 4 lety +1

    Thank you so much..keep uploading more like this...

  • @rakshith3547
    @rakshith3547 Před 3 lety

    as always.. classy!

  • @pramodsharma4508
    @pramodsharma4508 Před 4 lety

    Good explanation of the problen... Kevin you are doing a great job...can you make more videos on backtracking....

  • @ayaz.unstoppable
    @ayaz.unstoppable Před 4 lety +1

    Sir u r great

  • @nderitupatrick9949
    @nderitupatrick9949 Před 3 lety

    Good explanation. Thanks bro

  • @valkon_
    @valkon_ Před 2 lety

    Thanks a lot man!
    I have a silly question for whoever that can help me. In general leetcode problems are grouped in patterns, sliding window, two pointers, dfs, bfs etc.
    Which is the pattern here for these kind of questions? I am having some hard time categorising it. (not only that)

  • @rafaeluresti3832
    @rafaeluresti3832 Před 4 lety

    awesome approach and explanation! thank u bro

  • @sanjanasanthosh9446
    @sanjanasanthosh9446 Před 3 lety

    why is carry appended to result? when we are assigning sum as carry at first

  • @faraz7409
    @faraz7409 Před 4 lety

    thanks always helpful!

  • @SaurabhSaldi
    @SaurabhSaldi Před 3 lety

    How about using sb.insert(0,sum%10); won't need reverse later?

  • @vinayyelleti2714
    @vinayyelleti2714 Před 4 lety

    Can u pls upload solution for longest palindrome in a string

  • @vedanshbhardwaj6548
    @vedanshbhardwaj6548 Před 2 lety

    saw that (char) - '0' = int for the first time, any links to understand it better, why this works ??

  • @chiranjeevipippalla
    @chiranjeevipippalla Před 4 lety +3

    Hello Kevin. Please make a video on the leetcode problem #994 Rotten Oranges. Thank you.

    • @nityanandrai5341
      @nityanandrai5341 Před 4 lety

      just apply BFS in all 4 direction but leave the rotten place

    • @KevinNaughtonJr
      @KevinNaughtonJr  Před 4 lety

      made a vid on that! Just wanted to let you know if you haven't seen it yet :)

  • @EuLuisMelo
    @EuLuisMelo Před 4 lety +2

    I don't think the runtime is O(m+n), as we loop in both at once and the loop iterations is the same as the max(n1.length, n2.length).

    • @iGoValkyrie
      @iGoValkyrie Před 4 lety

      Are we really looping both of them at once though? We loop through both separately as you access String1 i first, i-- , then access String2 j, j-- and repeat. I thought of it like accessing arrays so it would make sense it's O(m+n).

    • @a.yashwanth
      @a.yashwanth Před 4 lety

      @@iGoValkyrie you wil increment both i and j simultaneously untill min(m,n) and continue adding remaining string till max(m,n). So it's max(m,n).

    • @a.yashwanth
      @a.yashwanth Před 4 lety

      @@iGoValkyrie if it were first i-- and then j-- he would've written 2 seperate while loops.

    • @KevinNaughtonJr
      @KevinNaughtonJr  Před 4 lety +1

      Yeah should have said that the runtime is the max of the lengths of num1 and num2 my fault!

  • @darod6098
    @darod6098 Před 4 lety

    The problem says "You must not use any built-in BigInteger library or convert the inputs to integer directly".
    Doing "num1.charAt(i) - '0'" is not exactly converting it, right? I dont think other way to do it though

    • @ashish4k07
      @ashish4k07 Před rokem

      In c++ it's num1.at(i)-'0' basically that and this returns an integer value or convert char to int cuz '0' has some ASCII value let us say 48 and num1.at(i) is also '0' then ASCII value of both of them are same so result is 0 same with ASCII value of 1 - ASCII value of 0 returns 1 so this is how that's working

  • @anushree3744
    @anushree3744 Před 4 lety +1

    Can't we first reverse both the input strings, add character by character and return the reversed output?

  • @shammykumar5537
    @shammykumar5537 Před 2 lety

    They way Kevin is solely different from other youtubers is because he just makes the question solution so freakin easy that a noob will also get confidence🔥🔥

  • @vman049
    @vman049 Před 4 lety +2

    Great video! Could you please explain why time complexity is not O(max(M,N))? Aren't we iterating both strings at once rather than serially?

    • @gatoradelight
      @gatoradelight Před 4 lety +2

      You're correct, pretty sure he said it by accident

    • @shanmukh111
      @shanmukh111 Před 3 lety

      Yes you're right, it should be O(max(m,n))

  • @jazzpants
    @jazzpants Před 4 lety

    I kid you not, I just skipped over this exact problem 3 hours ago and went on to another problem. Guess I can’t skip it tonight, huh? 😜😂😂😂

  • @davithov
    @davithov Před 2 lety

    why runtime is O(m + n)? I think it is O(max(m, n))

  • @Homelander007
    @Homelander007 Před 4 lety

    1268. Search Suggestions System and 1192. Critical Connections in a Network ?
    can you help with this ?

  • @iGoValkyrie
    @iGoValkyrie Před 4 lety +2

    I didn't get why '5' - '0' turns 5 into an integer. Someone care to explain?

    • @Khabibullah
      @Khabibullah Před 4 lety

      I think Difference between their ASCII values is itself an integer representing that numeric character

    • @a.yashwanth
      @a.yashwanth Před 4 lety +2

      Say ASCII value of 0 is 51 and ASCII value of 5 will be 56(51+5).
      So ASCII of 5 - ascii of 0 = 5.
      Same goes for any character in ASCII.
      This works because when you subtract 2chars in any language they subtract ASCII value of them.

  • @Khabibullah
    @Khabibullah Před 4 lety +1

    Bro try to upload more frequently. And do more medium questions

    • @KevinNaughtonJr
      @KevinNaughtonJr  Před 4 lety +2

      Working on it!

    • @Khabibullah
      @Khabibullah Před 4 lety +2

      @@KevinNaughtonJr Bro your coding series motivated me to do coding. You're the best

  • @a.yashwanth
    @a.yashwanth Před 4 lety +5

    Isn't runtime O(max(n,m))?

    • @FilmerWilliam
      @FilmerWilliam Před 4 lety +2

      that's what i'm thinking too. If it were O(m + n) then you'd be processing one string, then the other after. Here the processing is done in the same loop, but the loop breaks at the end of the longer string

    • @KevinNaughtonJr
      @KevinNaughtonJr  Před 4 lety

      Yeah really should have said that my fault!

  • @pramilagharti
    @pramilagharti Před 4 lety

    can you give me the solution in python

  • @timothyk5
    @timothyk5 Před 3 lety

    i just failed on this question lol