minus-squaregifti@programming.devtoProgramming Challenges@programming.dev•[Easy] Bracket Simplificationlinkfedilinkarrow-up2·edit-21 year agoI know I’m too late – but nonetheless … Factor: [ [ dup “()” “[]” “{}” [ “” splitting:replace ] tri@ tuck = not ] loop print flush ] each-line Edit: Thanks to the Alexes from the Factor Discord for xer suggestion! linkfedilink
minus-squaregifti@programming.devtoProgramming Challenges@programming.dev•[Easy] String Compressionlinkfedilinkarrow-up2·edit-21 year agoFactor: (command-line) last [ ] group-by [ length 48 + swap ] assoc-map “” concat-as print linkfedilink
I know I’m too late – but nonetheless …
Factor:
[ [ dup “()” “[]” “{}” [ “” splitting:replace ] tri@ tuck = not ] loop print flush ] each-line
Edit: Thanks to the Alexes from the Factor Discord for xer suggestion!