Maximum difference between adjacent elements of list: Difference between revisions
Maximum difference between adjacent elements of list (view source)
Revision as of 14:41, 19 July 2021
, 2 years agoAdd J
Not a robot (talk | contribs) (Add APL) |
Not a robot (talk | contribs) (Add J) |
||
Line 237:
(7.0,(2.0,9.0))
(7.0,(10.0,3.0))</pre>
=={{header|J}}==
<lang j>maxdiff =: ([(([:>./]),.[#~]=[:>./])[:|@-/"1])@(2:,/\])</lang>
{{out}}
<pre> maxdiff 1 8 2 _3 0 1 1 _2.3 0 5.5 8 6 2 9 11 10 3
7 1 8
7 2 9
7 10 3</pre>
=={{header|Julia}}==
|