@@Acodedaily Observations unexplained to the viewers 1. Why should there be only 2 colors at max to color the brackets? 2. How to decide to use a stack to color the brackets in their respective colors?
@@shri9229 whenever you put out an explanation video, first list out all the observations you could make with their respective proofs and then explain the implementation of such observations.
#include #define int long long using namespace std; signed main() { int t; cin>>t; while(t--) { int n; cin>>n; string s; cin>>s; int maxx=INT_MIN; for(int i=0;i
When j==i you are comparing s[i] with s[i] which make extra count as you already set count=1 and you no need min case after loop end you need max(maxx,cnt) then you will get right ans
Discord: discord.com/invite/H8TeFjvq6z
Keep it up , don't stop , u are doing a great work , very helpful to many people
today's contest was weirdly easssy, extremely easy.
Really helpful man. Hope to see more videos consistently from you.
I mostly do. Unless I am extremely busy.
why u didn't try to solve E , instead of recording ?
Felt like maths oriented. And I'm not strong at it.
bro in second question i dont understand the curr you used inside the loop how it work shoudnt it work if i initialize it outside the loop
Initialising it inside the for loop ( for(init;;)) or outside won't matter actually
In Problem D, i was not able to observe that k lies between 1and 2😶
It would be a combination of type1 and type2 at max. So it won't need more than 2 colors
The explanation of D isn't very clear. U have to justify every observation as well.
Which part is unclear?
@@Acodedaily Observations unexplained to the viewers
1. Why should there be only 2 colors at max to color the brackets?
2. How to decide to use a stack to color the brackets in their respective colors?
@@virujthakur9260 I didn't use a stack, but I certainly released only 2 colors are sufficient.
@@shri9229 whenever you put out an explanation video, first list out all the observations you could make with their respective proofs and then explain the implementation of such observations.
@@virujthakur9260 it's his channel, he decides.
#include
#define int long long
using namespace std;
signed main() {
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string s;
cin>>s;
int maxx=INT_MIN;
for(int i=0;i
When j==i you are comparing s[i] with s[i] which make extra count as you already set count=1 and you no need min case after loop end you need max(maxx,cnt) then you will get right ans
@@nikhilsharma5595 Just decrementing the i counter before taking max worked. Thanks for the suggestion.
worst explanation