Very helpful channel, I come here often. Want to highlight a small mistake in visual explanation at 4:35, we should increment right count only if we have an extra available left open parenthesis for it. This means increment right only if l_count > r_count. In your explanation at 4:35 you have it the other way round. I see you didn't make the same mistake in code though, and therefore code got submitted.
@uniforcestelian79172 жыл бұрын
This channel is extremely helpful for understanding how to approach LC medium to hard lvl problems. Thanks and I hope you continue to upload these helpful videos.
@weeno43319 ай бұрын
this can also be done more cleanly IMO using a stack, but it would use O(n) space complexity vs this one that uses O(1)
@provarence7361Ай бұрын
I agree stack makes much more sense but may be non optimal
@jaleelpasha33018 ай бұрын
Why not just reduce the lcount, if it is greater than 0 when we encounter right parentheses?
@shreyashzanjal37298 ай бұрын
🎯 Key Takeaways for quick navigation: Greedy left tracking Balanced parentheses count Iterative string processing Made with HARPA AI
@sreejitchatterjee44382 жыл бұрын
Hey could you please link the video of the minimum remove parentheses? I couldn't find it on your channel
@crackfaang2 жыл бұрын
I’m on mobile and can’t link but in case you haven’t found it yet search for “facebooks #1 interview question” on my channel and you should find it. I think I named it “min. remove” instead of “minimum remove” to save space in the title