43 ms·
I think you mistyped J code. I don't know any J but what I understood from your comment that it should be something like </ +. >/ *.
by KarlKode 2y ago
I think you mistyped J code. I don't know any J but what I understood from your comment that it should be something like
</ +. >/ *.
- bruturis 2y agoYou are right, the correct code is .</ +. >./ To understand this you need to know that >. and <. are the min and max functions, and that in J three functions separated by spaces, f g h, constitutes a new function mathematically defined by (f g h)(x) = g(f(x), h(x)). An example is (+/ % #) which applied to a list gives the mean of the list. Here +/ gives the total, # gives the number of elements and % is the quotient.