1(1..10).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
2(1..10).find { |i| i % 5 == 0 and i % 7 == 0 } #=> nil
3(1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35
4(1..100).find { |i| i % 5 == 0 and i % 7 == 0 } #=> 351You can just use a set difference (aka minus) to see if one array includes all elements of another
2
3not_included = [1,2,3] - (1..9).to_a
4not_included # => []
5
6not_included = [1,2,3,'A'] - (1..9).to_a
7not_included # => ["A"]
8