Skip to content
Snippets Groups Projects
Commit 393ff878 authored by D Vengatesh's avatar D Vengatesh
Browse files

ex2 q10 done

parent 9db67b32
No related branches found
No related tags found
No related merge requests found
Pipeline #62 failed
s=input("Enter the string:")
max1=0
curr_max=0
for i in range(len(s)):
if s[i]=='(':
curr_max+=1
if(curr_max>max1):
max1=curr_max
elif s[i]==')':
curr_max-=1
if curr_max==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