MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/3uyl7s/daily_programming_puzzles_at_advent_of_code/cxj1onl/?context=3
r/programming • u/Aneurysm9 • Dec 01 '15
179 comments sorted by
View all comments
Show parent comment
3
Oneline for task 1 and 2 (returnValue.c for 1 and returnValue.f for 2)
body.split('').reduce((agg,value,index)=>{return{c:agg.c + (value=='('?1:-1),f: (agg.c<0 && agg.f<0 ? index : agg.f)}},{c:0,f:-1});
2 u/[deleted] Dec 01 '15 You guys are my heroes, lol.
2
You guys are my heroes, lol.
View all comments
Show parent comment
3
u/AndrewGreenh Dec 01 '15
Oneline for task 1 and 2 (returnValue.c for 1 and returnValue.f for 2)