RosettaCodeData/Task/Set/Jq/set-4.jq

5 lines
145 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# Set-intersection: A ∩ B
def stringset_intersection(A;B):
reduce (A|keys)[] as $k
({}; if (B|has($k)) then . + {($k):true} else . end);