fix
This commit is contained in:
parent
16e3eb2d8c
commit
567f057013
@ -4,9 +4,12 @@ def is_paired(input_string):
|
||||
|
||||
search = []
|
||||
|
||||
for chr in input_string:
|
||||
for i, chr in enumerate(input_string):
|
||||
if chr in open:
|
||||
search.append(close[open.index(chr)])
|
||||
if i == len(input_string) -1:
|
||||
return False
|
||||
|
||||
continue
|
||||
|
||||
if chr in (open + close):
|
||||
@ -19,7 +22,3 @@ def is_paired(input_string):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
||||
print(is_paired("() a[]b()c{[} [fds]gh"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user