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

0

u/jamosaur- Dec 01 '15
<?php foreach(str_split(file('i')[0])as$p=>$d)($f-=$d=='('?-1:1)>=0|$b?:$b=$p+1;echo"$f $b";

Part 1 and 2 golfed in PHP but some of us in the larachat slack