Add Strings
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
instagram: instagram.com/kevinnaughtonjr/
twitter: twitter.com/kevinnaughtonjr
1268. Search Suggestions System and 1192. Critical Connections in a Network ?
can you help with this ?
Instablaster.
Thanks for the videos Kevin, the helped me land an internship at Adobe in NYC.
NO WAY ALAN CONGRATS I'M SO HAPPY FOR YOU!!!!! :)))))
yessss coding interview question is back. thanks for recording as always
Anytime Casey!
amazing video bro! I love it!
simple and clean solution
Great one Bro..
And Hearty Congratulations on getting into Google
thank you soo much for your tutorials - super helpful!
Thank you so much..keep uploading more like this...
Anytime!
as always.. classy!
Good explanation of the problen... Kevin you are doing a great job...can you make more videos on backtracking....
Sir u r great
Good explanation. Thanks bro
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)
awesome approach and explanation! thank u bro
rafael uresti anytime!
why is carry appended to result? when we are assigning sum as carry at first
thanks always helpful!
anytime Faraz!
How about using sb.insert(0,sum%10); won't need reverse later?
Can u pls upload solution for longest palindrome in a string
saw that (char) - '0' = int for the first time, any links to understand it better, why this works ??
Hello Kevin. Please make a video on the leetcode problem #994 Rotten Oranges. Thank you.
just apply BFS in all 4 direction but leave the rotten place
made a vid on that! Just wanted to let you know if you haven't seen it yet :)
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).
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).
@@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).
@@iGoValkyrie if it were first i-- and then j-- he would've written 2 seperate while loops.
Yeah should have said that the runtime is the max of the lengths of num1 and num2 my fault!
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
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
Can't we first reverse both the input strings, add character by character and return the reversed output?
I think that could work too!
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🔥🔥
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?
You're correct, pretty sure he said it by accident
Yes you're right, it should be O(max(m,n))
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? 😜😂😂😂
Haha now you have to do it!!!
why runtime is O(m + n)? I think it is O(max(m, n))
1268. Search Suggestions System and 1192. Critical Connections in a Network ?
can you help with this ?
I'll add them to my list!
I didn't get why '5' - '0' turns 5 into an integer. Someone care to explain?
I think Difference between their ASCII values is itself an integer representing that numeric character
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.
Bro try to upload more frequently. And do more medium questions
Working on it!
@@KevinNaughtonJr Bro your coding series motivated me to do coding. You're the best
Isn't runtime O(max(n,m))?
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
Yeah really should have said that my fault!
can you give me the solution in python
i just failed on this question lol