I could not solve it when I saw this problem 1st time, I am proud that today I cracked this problem before watching your video. Thanks for posting videos, your content definitely helps me to progress!
@crackfaang2 жыл бұрын
Sometimes it’s like that. I can’t tell you how many solutions I had to look at and videos to watch before things started clicking for me. I think as long as you understand how/why a solution works, there’s no problem looking at it if you are stuck. It’s just important to learn it so that when you inevitably come across another similar question, you can apply what you learned
@YT.Nikolay2 жыл бұрын
@@crackfaang I watch your videos till the end because: want to be sure my solution is optimal, 2nd watched to the end counter +=1 :)
@TheBIKEDEALZ8 ай бұрын
had this question in Amazon automation position, but failed to do it - thanks for your explanation.
@sagarpanwar272410 ай бұрын
Why can’t you have a stack : push when you see ‘(‘ pop when you see’)’ if there is nothing to pop then the remaining ‘)’ are to be removed. Store the indices of ‘)’ and return the string without them. Any thing wrong with this approach?
@ketulshah54626 ай бұрын
I have same question.
@cfbf966 ай бұрын
you can, but in the interview they often ask you to solve without a stack
@shuier5259 ай бұрын
I feel the last several lines "elif cur_char == ")" res.append(cur_char)else:res.append(cur_char)" can be simply combined to "else:res.append(cur_char)"