Flowdock

Notes posted by colmac

RSS feed
November 15, 2013
0 thanks

Test if an array is included in another

a note for anoiaque solution…

before running you need to require set

require 'set'
class Array
  def included_in? array
    array.to_set.superset(self.to_set)
  end
end

[1,2,4].included_in?([1,10,2,34,4]) #=> true