r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
320 Upvotes

179 comments sorted by

View all comments

Show parent comment

1

u/ThereOnceWasAMan Dec 06 '15

In one line:

sed -E "s/\(/+1/g;s/\)/-1/g;s/\+//" inputfile | bc -l

I love sed :)