Jump to content

Equilibrium index: Difference between revisions

→‎{{header|jq}}: shave off one line
(→‎{{header|jq}}: shave off one line)
Line 1,528:
. as $in
| add as $add
| foreach range(10;length) as $i (
| if 0 == $add - .[0] then 0 else empty end,
[0, .[0], $add - .[0]]; # [before, pivot, after]
foreach range(1;length) as $i (
[0, .[0], $add - .[0]]; # [before, pivot, after]
$in[$i] as $x | [.[0]+.[1], $x, .[2] - $x];
if .[0] == .[2] then $i else empty end) ;
2,472

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.