D
Derek Cannon
Hello everyone, another easy question from a beginner: How do you create
a method to compare two arrays so that if they share at least 1 common
element it returns true?
For example:
a = %w(m w f)
b = %w(m w)
c = %w(t r)
share_elements?(a,b) #=> true
share_elements?(a,c) #=> false
Thanks for your time,
Derek
a method to compare two arrays so that if they share at least 1 common
element it returns true?
For example:
a = %w(m w f)
b = %w(m w)
c = %w(t r)
share_elements?(a,b) #=> true
share_elements?(a,c) #=> false
Thanks for your time,
Derek