Skip to content
Snippets Groups Projects
Commit ac1640b1 authored by K V Ragul's avatar K V Ragul
Browse files

assignment done

parent f8c43e56
No related branches found
No related tags found
No related merge requests found
Pipeline #102 canceled
str1=input("Enter string:")
max1=0
cmax=0
for i in range(len(str1)):
if str1[i]=='(':
cmax+=1
if(cmax>max1):
max1=cmax
elif str1[i]==')':
cmax-=1
if cmax==0:
print(max1)
else :
print("mismatch")
print(max1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment