2 ms·
It's not really fair since J has a built-in function, but in J the gcd function is +. 15 +. 10 5 The near-canonical example is the mean, which is not buil
by gcanyon 16y ago
It's not really fair since J has a built-in function, but in J the gcd function is +.
15 +. 10
5
The near-canonical example is the mean, which is not built in:
mean =: +/%#
mean 2 3 4 5
3.5
Other code is similarly terse. On http://projecteuler.net/ http://projecteuler.net/ it's not uncommon to see one-line J solutions to problems where other languages have solutions from 20 to 50 or more lines of code.