Skip to content

Instantly share code, notes, and snippets.

@lohxx
Last active March 7, 2018 22:57
Show Gist options
  • Save lohxx/9d2804521125259dcacf0ce2248ad73b to your computer and use it in GitHub Desktop.
Save lohxx/9d2804521125259dcacf0ce2248ad73b to your computer and use it in GitHub Desktop.
def bracketPush(comb):
combine = ''
for i in comb.split():
combine += i
print(combine)
print(comb.replace(" ",""))
if combine == comb.replace(" ",""):
return True
else:
return False
print(bracketPush("(]"))
def bracketPush(comb):
pairs = {"{":"{}","[":"[]","(":"()"}
combine = ''
for i in comb.split():
print(comb.index(pairs[i[0]][0]))
print(comb.index(pairs[i[-1]][-1]))
print(dir(str))
@lohxx
Copy link
Author

lohxx commented Mar 7, 2018

doing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment