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

Day 1 Mark

parent b492d33e
No related branches found
No related tags found
No related merge requests found
a = input.split("\n").map(x => x.split(" ").map(Number))
b = a.map(x => x[0]).sort()
c = a.map(x => x[1]).sort()
output2 = b.map((x,i) => Math.abs(x - c[i])).reduce((x,y)=>x+y)
b = a.map(x => x[0])
c = a.map(x => x[1])
output2 = b.map(x => x*c.filter(y=>x==y).length).reduce((x,y)=>x+y)
\ 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