In ruby you can intersect two arrays using the &
operator.
I'm trying to obtain the remainder of the intersection.
If I use a simple case -
is sufficient:
array_1 = [0, 1]
array_2 = [0]
array_1 - array_2 => [1]
Now imagine we have 0
appearing multiple times in the first array
array_1 = [0, 0, 1]
array_2 = [0]
array_1 - array_2 => [1]
I would like to know the easiest way to obtain the difference between the first array and the intersection of the first array and the second array
array_1 = [0, 0, 1]
array_2 = [0]
array_1 ??? array_2 => [0, 1]