2 ms·
J has the verbs behead[0] (for xs[1:]) and curtail[1] (for xs[:-1]), so the J oneliner for the above code would be <./ ([&}. - }:) xs [0] https://code.js
by ahgamut 6y ago
J has the verbs behead[0] (for xs[1:]) and curtail[1] (for xs[:-1]), so the J oneliner for the above code would be
<./ ([&}. - }:) xs
[0] https://code.jsoftware.com/wiki/Vocabulary/curlyrtdot https://code.jsoftware.com/wiki/Vocabulary/curlyrtdot
[1] https://code.jsoftware.com/wiki/Vocabulary/curlyrtco https://code.jsoftware.com/wiki/Vocabulary/curlyrtco
- floxy 6y agoThanks. The "right way" to do max of the differences (with the sort) in J might be something like? >./-2-/\/:~ xs