I need to take two strings, compare them, and print the difference between them.
So say I have:
teamOne = \"Billy, Frankie, Stevie, John\" teamTwo = \"Bi
You need to sort first to ensure you are not subtracting a bigger string from a smaller one:
def compare(*params) params.sort! {|x,y| y <=> x} diff = params[0].split(', ') - params[1].split(', ') if diff === [] true else diff end end puts compare(a, b)