Instead of an array, you can just use an empty string, say sum_str and do sum_str = str(curr_sum % 10) + sum_str. Then add the carry at the end in a similar fashion if it exists.
Your explanation is way easier to understand. I’m your subscriber. Can you please put a video on how to add string of two float Example: num1= “66.6778” num2= “34.986” Output : “101.6638”
Yes! I actually do this all the time but this question is an easy one and I figured some people might not be familiar with the deque and might get confused
great explanation, thank you
5-10 usually
Instead of an array, you can just use an empty string, say sum_str and do sum_str = str(curr_sum % 10) + sum_str. Then add the carry at the end in a similar fashion if it exists.
Time complexity would be O(max(N, M) ?
Your explanation is way easier to understand. I’m your subscriber. Can you please put a video on how to add string of two float
Example: num1= “66.6778” num2= “34.986”
Output : “101.6638”
Just a nit point, you can do carry in the while to not have the extra check for carry `while i>=0 or j >= 0 or carry:`
Can use a deque to skip the reverse at the end, by appending curr_sum to left in queue
Yes! I actually do this all the time but this question is an easy one and I figured some people might not be familiar with the deque and might get confused
@@crackfaangAwesome! Yea that’s what I like about your solutions you keep it simple, keep it up.
@@nikhilm907 can you teach me the solution that you mention?
Clean!
Glad you’re enjoying the content! Subscribe so you don’t miss the latest videos
Why isn’t time complexity max(n,m)?
Why Time complexcity would not be O(max(N,M))?
because he didn't do the direct concatanation of the string after i or j runs over. he padded with '0' instead
why using the INT() fiunction using, asci, not ok sol
It’s an easy level question, no need to overcomplicate things. This is more beginner friendly
can you send link to your discord, it seems to be expired in the descri of your videos