# frozen_string_literal: true require 'set' require 'forwardable' Array.class_eval do # @return [Boolean] def overlaps?(other) !(self & Array(other)).empty? end end Set.class_eval do extend Forwardable def_delegators :to_a, :overlaps? end