huluvu@programming.devtoProgramming Challenges@programming.dev•[Easy] Bracket Simplification
1·
1 year agodeleted by creator
deleted by creator
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