Logo

Programming-Idioms

History of Idiom 218 > diff from v2 to v3

Edit summary for version 3 by steenslag:
New Ruby implementation by user [steenslag]

Version 2

2020-01-09, 14:10:34

Version 3

2020-01-09, 16:30:30

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Idiom #218 List intersection

Create list c containing all unique elements that are contained in both lists a and b.
c should not contain any duplicates, even if a and b do.
The order of c doesn't matter.

Extra Keywords
intersect and conjunction
Extra Keywords
intersect and conjunction
Code
c = a & b
Demo URL
https://ideone.com/bZ3rvD