Skip to content
Snippets Groups Projects
Commit 47aec294 authored by Mark Jeeninga's avatar Mark Jeeninga
Browse files

Day 3 Mark

parent 49122794
No related branches found
No related tags found
No related merge requests found
output1 = input.split("\n").map(x => [...x.matchAll(/mul\((\d+),(\d+)\)/g)].map(x => Number(x[1]) * Number(x[2])).reduce((y,z)=>y+z,0)).reduce((y,z)=>y+z,0)
output2 = input.split("do()").map(x=>x.split("don't()")[0]).join(' ').split("\n").map(x => [...x.matchAll(/mul\((\d+),(\d+)\)/g)].map(x => Number(x[1]) * Number(x[2])).reduce((y,z)=>y+z,0)).reduce((y,z)=>y+z,0)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment