BartlomiejSkwira
11/3/2017 - 11:19 AM

Check if one array contains elements of another

Check if one array contains elements of another

a = [5, 1, 6, 14, 2, 8]
b = [2, 6, 15]

a - b
=> [5, 1, 14, 8]

b - a
=> [15]

(b - a).empty?
=> false