huluvu
joined 1 year ago
python 3 using regex:
import re
i=input()
p=r'(?:\(\)|\{\}|\[\])'
while re.search(p,i):
i=re.sub(p,'',i)
print(i)
edit: made it uglier for the least characters challenge
python 3 using regex:
import re
i=input()
p=r'(?:\(\)|\{\}|\[\])'
while re.search(p,i):
i=re.sub(p,'',i)
print(i)
edit: made it uglier for the least characters challenge
It’s probably adding compilation time, because a system that runs my python regex in 40ms should probably run this rust program in less than 1ms