Run-length encoding: Difference between revisions
→{{header|jq}}: ensure runs/0 works with jq 1.4 and later
m (→{{header|jq}}: correct typo) |
(→{{header|jq}}: ensure runs/0 works with jq 1.4 and later) |
||
Line 1,830:
( [];
if . == [] then [ [ $item, 1] ]
| if $last[0] == $item then
else . + [[$item, 1]]
end
|