r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
325 Upvotes

179 comments sorted by

View all comments

Show parent comment

2

u/fezzinate Dec 02 '15

Simplified even further by doing the replace with regex:

eval(input.replace(/\(/g, "+1").replace(/\)/g, "-1"));