Is This a Give-Away?

Once there lived an ancient mage named Farabi. He could always give perfect weather forecast. He nev…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

#include
#include<string.h>
using namespace std;
int main(){
char t [100003];
scanf (“%s”, t) ;
int s = 0 , a = 0 , l = strlen ( t );
for( int i = 0 ; i <= l / 2; i++) if( t[i] == ‘{’ ) s++;
for( int i = l ; i>=l/2; i–) if( t[i] == ‘}’ ) a++;
cout<< min ( a , s );
}
what’s the problem with my code here?