Hi Gys, Video is long, if you want to Jump to most Optimal Solution pls go from Approach 2 -directly-> Approach4 (Only 2 Approaches) If you want to understand reversing strategy in Paranthesis problem -> Approach3 Basic Human Approach -> Approach1 I don't want to waste your time, so pls jump to specific Approaches you like ❤ New VIDEO - czcams.com/video/uXIXVKDnHX0/video.htmlsi=R89M32F_p2HNheUs
Hi Aryan, as you said that ans+=char takes O(n) operation in java and c++ too but as I code in java I thing there is no other option to append character at back. If you know pls can you mention it.
Nhi nhi sir, ans += c will take o(1) but same is not true for string, as ans += c in cpp internally calls push back only, same ig works in java too, but so as to mot get confused & mistakenly use += with strings, i always recommend using push_back
Hi Gys, Video is long, if you want to Jump to most Optimal Solution pls go from Approach 2 -directly-> Approach4 (Only 2 Approaches)
If you want to understand reversing strategy in Paranthesis problem -> Approach3
Basic Human Approach -> Approach1
I don't want to waste your time, so pls jump to specific Approaches you like ❤
New VIDEO - czcams.com/video/uXIXVKDnHX0/video.htmlsi=R89M32F_p2HNheUs
Great Explanation Bro ....amazed to see you explaining such things at this age keep it up bro
Love u bro u 💗
we could use a two pointer approach too - , which would be a one pass solution
Your intuitive way of explaining things is just awesome!!! Please don't stop making videos like this of daily leetcode challanges!
Bro last Solution was 🔥
❤️❤️🫂thank u sir
I Usually Solve the Question and then come here to get the Optimal Solution.
and I like it
Same here
based Aryan, the Austrian painter was rigth
We can also use the string::operator+=, which is overloaded for chars and internally calls to the push_back() function.
Yes sir, but just be cautious on char* or string, then this won’t be calling pushback, but yeah for characters it works same🔥🫡
hi, Aryan! in approach 4 if we traverse the string backward and move "(" until dif is 0, will it work?
Hi Aryan, as you said that ans+=char takes O(n) operation in java and c++ too but as I code in java I thing there is no other option to append character at back. If you know pls can you mention it.
Nhi nhi sir, ans += c will take o(1) but same is not true for string, as ans += c in cpp internally calls push back only, same ig works in java too, but so as to mot get confused & mistakenly use += with strings, i always recommend using push_back
@@ARYANMITTAL Ok thanks.
@@ARYANMITTAL Ok Thanks now It's clear.
@@ARYANMITTAL area bhai buT JAVA mai kai hota hai (jasea C++ mai hota hai `push_back` for strings) vasea ?