Leah Neukirchen / Jun 11 2021 / Published
J examples
The J programming language, developed in the early 1990s by Kenneth E. Iverson and Roger Hui, is an array programming language based primarily on APL.
1 2 3 + 4 5 6
0.5s
J
Advent of Code 2020
Day 01: Report Repair
… you to find the two entries that sum to
2020
and then multiply those two numbers together.
d=: (".;._2)1!:1<}:}.'_'
*/2{.d/:(2020-d)i.d
0.4s
… what is the product of the three entries that sum to
2020
?
*/ {:"1 (#"1~ 2020&=@:(+/)) |: d {~ ((#: i.@(*/)) 3 ## d)
1.0s