You re brilliant! Your explanation saved my days. I read so many solutions regarding to Space O(1) solution, but cant understand till watch your video. Thanks bro!!!
Nice job, pointer manipulation is little tricky but you got it right :) Another solution is to use the stack. Push the char into stack if it's not '#' otherwise pop if it's not empty. Repeat for both the strings and then compare the stacks.
Because in time complexity, you drop the constants (any numbers) because as the input size gets bigger, the constant makes less of a difference. So for n*2, drop the 2 and you get n.
Thanks a lot for such a wonderful explanation, it would be great if you could create some course of all the leetcode and hackerRank problems explanation course - paid/unpaid that would be a great help to human society 😇🍺
You re brilliant! Your explanation saved my days. I read so many solutions regarding to Space O(1) solution, but cant understand till watch your video. Thanks bro!!!
who came after seeing this question on leetcode 30days coding challenge😅😅
me here
tum dono ka baap
Nice job, pointer manipulation is little tricky but you got it right :)
Another solution is to use the stack. Push the char into stack if it's not '#' otherwise pop if it's not empty. Repeat for both the strings and then compare the stacks.
A stack wouldn't be O(1) space
@@karenhuynh1355 hey bro, you make this place so serious, haha, joking, good point
This is not a easy catogery problem at all !! 😂😂
I like how you show that you've tried and failed many times before... Hope we meet at fang some day😁
i was doing the same thing but was not skipping the characters one by one. thanks nick
smart. I say that because I solved it the same way ;) However, instead of copy & paste I employed a lambda to find the next non-backspace character
Can you explain how it's time complexity is o(n) rather than o(n*2)
Because in time complexity, you drop the constants (any numbers) because as the input size gets bigger, the constant makes less of a difference. So for n*2, drop the 2 and you get n.
I just have the doubt of why do you decrease the skips.
Something went wrong. Please try again or refresh the commment.
Thanks a lot for such a wonderful explanation, it would be great if you could create some course of all the leetcode and hackerRank problems explanation course - paid/unpaid that would be a great help to human society 😇🍺
Bro I know I am a bit late but please get some rest you look tired 😌
Thank you very much for this video
thanks Nick
you the man
may be using 2 stacks would be little easy to implement
true, but the problem want solvers to use O(1) space
How is this easy?!?! T_T
tricky
Review
can be implemented using stacks....
stacks is not O(1) space
can be done through stack in 1 ms
stack is not space complexity O(1), the problem follow up wants you to solve it in space O(1), and this video is for that
@@happycoding1093 ooh now I got that....okk