Skip to main content
Commonmark migration
Source Link

#Python 3, 196 170 160 154 bytes

Python 3, 196 170 160 154 bytes

Awkwardly long, thanks to Mego for saving 6 bytes:

d=y=""
for C in input():
 for a in "[](){}":y+=C*(C==a)
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)

#Python 3, 196 170 160 154 bytes

Awkwardly long, thanks to Mego for saving 6 bytes:

d=y=""
for C in input():
 for a in "[](){}":y+=C*(C==a)
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)

Python 3, 196 170 160 154 bytes

Awkwardly long, thanks to Mego for saving 6 bytes:

d=y=""
for C in input():
 for a in "[](){}":y+=C*(C==a)
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)
added 24 characters in body
Source Link
Adnan
  • 44.5k
  • 6
  • 82
  • 246

#Python 3, 196 170 160160 154 bytes

Awkwardly long, still golfingthanks to Mego for saving 6 bytes:

d=y=""
for C in input():
 for a in "[](){}":
  if y+=C*(C==a:y+=C)
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)

#Python 3, 196 170 160 bytes

Awkwardly long, still golfing:

d=y=""
for C in input():
 for a in "[](){}":
  if C==a:y+=C
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)

#Python 3, 196 170 160 154 bytes

Awkwardly long, thanks to Mego for saving 6 bytes:

d=y=""
for C in input():
 for a in "[](){}":y+=C*(C==a)
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)
deleted 2 characters in body
Source Link
Adnan
  • 44.5k
  • 6
  • 82
  • 246

#Python 3, 196 170 160 bytes

Awkwardly long, still golfing:

y=""d=y=""
for C in input():
 for a in "[](){}":
  if C==a:y+=C
 y=y.replace("()",""d)
x=y
for r in y:x=x.replace("{}",""d)
for s in y:x=x.replace("[]",""d)
print(x==""x==d)

#Python 3, 196 170 160 bytes

Awkwardly long, still golfing:

y=""
for C in input():
 for a in "[](){}":
  if C==a:y+=C
 y=y.replace("()","")
x=y
for r in y:x=x.replace("{}","")
for s in y:x=x.replace("[]","")
print(x=="")

#Python 3, 196 170 160 bytes

Awkwardly long, still golfing:

d=y=""
for C in input():
 for a in "[](){}":
  if C==a:y+=C
 y=y.replace("()",d)
x=y
for r in y:x=x.replace("{}",d)
for s in y:x=x.replace("[]",d)
print(x==d)
deleted 10 characters in body
Source Link
Adnan
  • 44.5k
  • 6
  • 82
  • 246
Loading
Source Link
Adnan
  • 44.5k
  • 6
  • 82
  • 246
Loading