forked from Akanksha1212/C_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathind.c
More file actions
31 lines (25 loc) · 605 Bytes
/
ind.c
File metadata and controls
31 lines (25 loc) · 605 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<stdio.h>
#include<string.h>
int main () {
char a[1000000];
int t,max,c,i,j,l;
scanf ("%d",&t);
for (j=0;j<t;j++)
{
scanf("%s",a);
l=strlen(a);
max=0;
c=0;
for (i=0;i<l;i++)
{
if (a[i]=='(')
c=c+1;
else
c=c-1;
if(c>max)
max=c;
}
printf("%d\n",max);
}
return 0;
}