17:23 bhaiya I was literally watching this episode at that same time 😂, goosebumps aa gye the jesei aapne same time bataya. Hats off to your dedication. Very inspiring 💙
This is the best++++ channel for programming (not only for competitive programming). Bs afsoos ye hai ki jaha paisa dete hai (college) waha Aisa content nhi milta . 👏❤️❤️
This is just to let you know that this is the first time when someone has explained me "how to code" with such clarity! I am really very amazed and motivated today because of this video playlist. thank you luv sir
Lol.. I missed the last blooper part !😂 Man ! I can't believe you are an engineer and @ 4 am you are teaching us. If we can't like, comment, share and most importantly learn from your amazing contents, this will be so so unfair. ❤❤❤❤❤ Hope one day I can meet you !!!🙏🙏🙏
Thank you luv bhaiyya you are putting your love and soul to this playlist ❤️❤️ You are to amazing that you are making video early in the morning I appreciate your Hardwork
bhaiya thanks for the content .and especially jo aap questions add kr dete hain saari videos ke baad haclkerrank ya codeforced ki ,thath"s helping a lot in practising
I was about to quit competitive programming but after start watching your course I started to take part in contest going on and currently 2* coder at codeshef thanks a lot luv bhai.
showing segmentation core dumped #include using namespace std; #define pb push_back #define pp pop_back #define f first #define s second #define REP(i, a, b) for (int i=a; i m={{'[',1},{'{',2},{'(',3},{']',-1},{'}',-2},{')',-3}}; string check(string &st) {
stack w; for(char bracket: st) { if(m[bracket]>0) w.push(bracket); //if opening bracket else { if (st.empty()) return "NO"; int a=m[bracket]; char topmost=w.top(); int b=m[topmost]; if(a+b!=0) return "NO"; else w.pop();
} } if (w.empty()) return "YES"; else return "NO"; } int main() { int t;cin>>t; while(t--) { string s; cin>>s ; cout
Please try to attach more practice questions. It is difficult to find good ONLY STL related questions. What we mostly get is mixed complex algorithm questions having the use of STL. It would help a lot. Thanks :)
First! Bhaiya jiss cheez mein bhi problem aati h na aap jaldi se ussi ki video post kr dete ho.. Really you are helping a lot Matlab maine vector of vector and set of set kayi jagah search kare lekin smjh nhi aaye aapki video se sab smjh aagya...thanks a lot:)
Luv bhaiya ide k liye kux recommend kijiye c++ k liye m filhal atom use krra hun and mera vs code bht zyaada bug show krra h I don't know how to resolve it Very nyc explaination you are giving loving it👍👍👍
I didn't understand the code in line 13, why are we popping the stack, even though we haven't yet checked whether the top element is complementary to the bracket value or symbols[top] + symbols[bracket] ==0 or not, shouldn't we only pop when the opening bracket is same as closing bracket
Bhai ek doubt h if we take string"= { ]" Then your code goes wrong Qnki wo for loop ke else me jaga Jaha wo empty check krega but wo hai ni to aage bdhega Fir wo pop krega and then compare to NO print krega but Jb wo pop krega to "{" Nikl jaega aur stack empty hojaega to... For ke bahar wle me jo empty check kr rhe us pr yes print krdega So output NO YES AEGA ABOVE STRING KA..?;
Your logic is awesome but I think we can have a simpler approach by using unordered_map string isBalanced(string s) { unordered_map symbol = {{'(', ')'}, {'{', '}'}, {'[', ']'}}; stack st; for (char bracket : s) { if (symbol.find(bracket) != symbol.end()) st.push(bracket); else if (st.empty() || bracket != symbol[st.top()]) return "NO"; else st.pop(); } if (st.empty()) return "YES"; return "NO"; } As this is a very popular question, so hope this code helps. And thanks luv bhai.. sab aap ka sikhaya hua he..🙏
One day my junior will ask best TH-cam channel for C.P. and I will suggest this one.. Totally awesome and precise, concrete and crisp content.... Bhaiya just increase the frequency of videos(if possible, I know this type content is difficult to make)
10:30 Now this is what I came for and this is what makes your video unique and better than everyone... can't thank you enough ❤️️❤️️❤️️
we can use pair instead of unordered map also ??
@@piyushgarg511 I think no.Because in case of map we can access value with key(map[key1]+map[key2]==0 or not). But in case of pair we can't do that.
@@piyushgarg511 yes we can
pair p[3] = {{'[',']'},{'(',')'},{'{','}'}};
string isBalanced(string s) {
stack bracket;
for(auto i = s.begin();i!=s.end();i++){
if(*i=='{' || *i == '['||*i=='('){
bracket.push(*i);
}else if(bracket.empty()){
return "NO";
}else if(*i==p[0].second && bracket.top()==p[0].first){
bracket.pop();
}else if(*i==p[1].second && bracket.top()==p[1].first){
bracket.pop();
}else if(*i==p[2].second && bracket.top()==p[2].first){
bracket.pop();
}else return "NO";
}
if(bracket.empty()) return "YES" ;
else return "NO" ;
}
17:23 bhaiya I was literally watching this episode at that same time 😂, goosebumps aa gye the jesei aapne same time bataya.
Hats off to your dedication. Very inspiring 💙
By seeing your competitive programming playlist.
I can't give excuses to myself for not learning Computitve programming.
Thank you bhai 😍😍😘😘😘😘
This is the best++++ channel for programming (not only for competitive programming).
Bs afsoos ye hai ki jaha paisa dete hai (college) waha Aisa content nhi milta .
👏❤️❤️
This is just to let you know that this is the first time when someone has explained me "how to code" with such clarity! I am really very amazed and motivated today because of this video playlist.
thank you luv sir
Lol.. I missed the last blooper part !😂
Man ! I can't believe you are an engineer and @ 4 am you are teaching us. If we can't like, comment, share and most importantly learn from your amazing contents, this will be so so unfair.
❤❤❤❤❤ Hope one day I can meet you !!!🙏🙏🙏
I am pretty sure that this channel will grow exponentially because of having Amazing content
Thank you luv bhaiyya you are putting your love and soul to this playlist ❤️❤️
You are to amazing that you are making video early in the morning
I appreciate your Hardwork
only who has watched till end knows about this xD
@@iamluv I have watched it bro till end.
bloopers are fun.....do include them.
And your content obviously is best.
Is video ka Blooper sabse best h lol, and thanks a lot luv bhai aap humare liye itni mahenat kr rhe ho :)
This took me more than 1.5 hrs to implement by myself but was able to do it. Thanks for the series.
bhaiya thanks for the content .and especially jo aap questions add kr dete hain saari videos ke baad haclkerrank ya codeforced ki ,thath"s helping a lot in practising
how underrated you are!!
It is very disappointed to me.
This playlist is mind blowing, you deserve at least 1 million.
Love from Bangladesh!!!
I love content of this channel very very helpful and no one gives this level of content
I never loved c++ but after your video i fall in luv with c++ with luv❤️
I Madara Uchiha , declare you the bestest teacher ever :)
Wake up to reality....
@@AnoNymOuS-mg9oj then you suggest some?
naruto ko dekha
He doesn't even remember your name, a fitting end perhaps
Best itself is superlative
I was about to quit competitive programming but after start watching your course I started to take part in contest going on and currently 2* coder at codeshef thanks a lot luv bhai.
HOW R U NOW ? any did you improve more?
Luv Bhaiya you are simply amazing
Can't thankyou much for the course......
Par loving this.....
And your efforts are awesome
Appreciable ♥️
showing segmentation core dumped
#include
using namespace std;
#define pb push_back
#define pp pop_back
#define f first
#define s second
#define REP(i, a, b) for (int i=a; i m={{'[',1},{'{',2},{'(',3},{']',-1},{'}',-2},{')',-3}};
string check(string &st)
{
stack w;
for(char bracket: st)
{
if(m[bracket]>0) w.push(bracket); //if opening bracket
else
{
if (st.empty()) return "NO";
int a=m[bracket];
char topmost=w.top();
int b=m[topmost];
if(a+b!=0) return "NO";
else w.pop();
}
}
if (w.empty()) return "YES";
else return "NO";
}
int main()
{
int t;cin>>t;
while(t--)
{
string s; cin>>s ;
cout
Please try to attach more practice questions. It is difficult to find good ONLY STL related questions. What we mostly get is mixed complex algorithm questions having the use of STL. It would help a lot. Thanks :)
subah ke 4:50 pe video ban rahe ho hamare lie thank you sirrrr
Great explanation and unique solution ,, sir..😍
Love from Bangladesh 🇧🇩
thanks for creating such an informative playlist , i have shared this with my friend so that they too could understand stl in the most easiest way.
First! Bhaiya jiss cheez mein bhi problem aati h na aap jaldi se ussi ki video post kr dete ho..
Really you are helping a lot
Matlab maine vector of vector and set of set kayi jagah search kare lekin smjh nhi aaye aapki video se sab smjh aagya...thanks a lot:)
Masterpiece, Love from Bangladesh....😍😍😍😍😍😍
cp valw mote paren vai?
loved the way how easy you made this question😍😍
Great explanation🔥...aur bloopers bhi Dekh Kar Maja aata hai😂
Bhai course to badhiya hai hi aur saath me bloopers dekhke maza aa jaata😂😂😂
great approach and explanation 👌
Definitely best implementation.
Rich content indeed.
~Take ♥ from Bangladesh
Thanks a lot for this playlist!
Love your way of solving it differently sir !!
awesome bro i saw this problem & solution multiple time but this solution is pretty more better
8:36 I have a doubt : When do we take input of test cases and when not ?
U made Medium to hard problem as very very easy, thank you bro..❣
Aap bahut hi badhiya padhate ho
BEST APPROACH FOR THIS PROBLEM ON TH-cam
17:16 best part of the video🤣😂😂🤣😂😂
What a unique approach ♥️♥️ Ly bhaiya ..I think this approach is not available on entire youtube except Luv ✌✌
Brroooo,I was waiting for this 🔥🔥❤️
Best teacher I have ever seen
Your explanation are really rock. Thank you soo much😊😊
Awesome approach Bro!! Much appreciated.
salute to see your hardwork bhiya , and thanks for the playlist . ❤
thank you so much for such videos
You explain as if I am teaching myself 👌👌
👏👏👏 appreciation for your efforts ❤️
Bloopers made this content enjoyable.
bhai saahab code ho toh aisa !!! maza aa gaya logic dekh ke
Mza aa gya unordered Map wla code dekh k
You are doing a great work broo..🔥
simple and unique idea to solve problem
❤️❤️best cp content on utube...u will get 100k subs within a month I know...
Commenting for better reach
Mast content op yeah sab bhi likh skta hu per ( gold/ 💎) ko bolna tum expensive ho bolna nhi ho jaayega 🤔😅
Luv sir we appreciate your efforts and INT_MAX love from a freshie from your college
❤️❤️
Luv bhaiya ide k liye kux recommend kijiye c++ k liye m filhal atom use krra hun and mera vs code bht zyaada bug show krra h I don't know how to resolve it
Very nyc explaination you are giving loving it👍👍👍
Excellent Gurujii
Wow aap subhe bhut jaldi uthe ho. Vese jaldi utne ki koshish ki and bhut productive jata hai din
jldi uthta nhi hu.. late sota hu.. 👀
@@iamluv same bhai raatko mujhe productive hota hai
We can also use the difference in ASCII values of string value and the topmost
element of the stack,
CODE:
if( s.empty()==false && (str[i] - s.top())
10:30 we can use pair instead of unordered map also ??
Best explanation till date
St. pop(), hmlog if condition ke baad else mein rkhte toh sahi rhta?
18:00 wo kya hai ? wo kon sa device hai ???
such an elegant code! :D wow❤️️
And again you rocked it bro!!
As Unordered map do not allow duplicate keys, If the brackets repeats in that case it wont work?
BEST !! CP course
Thanks from bottom of my heart .🙏
Baground music is so good 😊
I didn't understand the code in line 13, why are we popping the stack, even though we haven't yet checked whether the top element is complementary to the bracket value or symbols[top] + symbols[bracket] ==0 or not, shouldn't we only pop when the opening bracket is same as closing bracket
Yes you are right i am also confused.
Thanks for your effort sir !!
u are amazing . thnx for ur hardwork.
can you use some different variable name in char top= st.top() 14:35
thanks bro its morning 4.50 am
best_teacher_ever 🔥🔥🔥
this code is showing error brace-enclosed initializer list
how to remove this
u explain so well .woww☺
Bhai ek doubt h if we take string"= { ]"
Then your code goes wrong
Qnki wo for loop ke else me jaga Jaha wo empty check krega but wo hai ni to aage bdhega Fir wo pop krega and then compare to NO print krega but Jb wo pop krega to "{" Nikl jaega aur stack empty hojaega to... For ke bahar wle me jo empty check kr rhe us pr yes print krdega
So output NO YES AEGA ABOVE STRING KA..?;
Please explain symbols[brackets] and symbols[top]
i am just using the unordered map, watch maps and unordered maps episode once if you havent watched it
Thank you sir ❤️
Thanks buddy 😊😊
Understood sir❤🙇♂🙏
can we check palindrome of , by this balanced bracket matching ?
great series
Love you bhaiya ❤️
thankyou for this amazing content🤗.
Your logic is awesome but I think we can have a simpler approach by using unordered_map
string isBalanced(string s)
{
unordered_map symbol = {{'(', ')'}, {'{', '}'}, {'[', ']'}};
stack st;
for (char bracket : s)
{
if (symbol.find(bracket) != symbol.end())
st.push(bracket);
else if (st.empty() || bracket != symbol[st.top()])
return "NO";
else
st.pop();
}
if (st.empty())
return "YES";
return "NO";
}
As this is a very popular question, so hope this code helps.
And thanks luv bhai.. sab aap ka sikhaya hua he..🙏
Can u please upload that topic String algorithm and dp as soon as possible🥺
after stl, i am going to cover numbery theory bit manipulation graph theory and then will come dp. We are going in order here.
@@iamluv ❤️❤️thnku for reply😊
Super video bro 🇮🇳🌹🇮🇳
we can solve above problem by using vector in same time,space complexity...then what is the point of using stack
all: teaching first
me: bloopers first
why did u add st.pop() in line 13 ? what is the need of that ?
symbols[top] + symbols[bracket]
but in top and bracket there is character value , how the compiler have picked integer value.
symbols[top] ek map hai isske corresponding hmne int value store ki hai jese
map['(']=-2 ; map[')']=2
One day my junior will ask best TH-cam channel for C.P. and I will suggest this one.. Totally awesome and precise, concrete and crisp content....
Bhaiya just increase the frequency of videos(if possible, I know this type content is difficult to make)
I post 2 videos a week. Cant increase more than that. This only is difficult
❤️❤️
sir you used st.pop() before the condition why so ?
God bless you bahi
what a clever solution loved it
Bhaiya mera ye code
Input - (
Ke liye balanced bta rha hai..
Please koi help kro 🙏
Bro unordered map m to duplicate value store n hoti to Agr string m open bracket 2 baar aye to unordered map to use ek hi baar manega
unordered map thing was smart :D
can u pls solve the ques dense brackets using stack. I m a bit stuck writing the code. please help me out