Department numbers: Difference between revisions
→{{header|jq}}: combinations
(→{{header|jq}}: {$x}) |
(→{{header|jq}}: combinations) |
||
Line 2,012:
The second illustrates how essentially the same algorithm can be written in a more economical way, without sacrificing comprehensibility.
The third illustrates how the
The solutions in all cases are presented as a stream of JSON objects such as:
Line 2,038:
and .police % 2 == 0 )</lang>
'''
<lang jq>
| combinations(3)
| select( add == 12 and .[0] % 2 == 0)
|
=={{header|Julia}}==
|