Skip to content

Instantly share code, notes, and snippets.

@Haumer
Created September 14, 2020 15:27
Show Gist options
  • Select an option

  • Save Haumer/46561a6c937de797435afb9efcff08d1 to your computer and use it in GitHub Desktop.

Select an option

Save Haumer/46561a6c937de797435afb9efcff08d1 to your computer and use it in GitHub Desktop.
require 'set'
teamOne = "Billy, Frankie, Stevie, John"
teamTwo = "Billy, Frankie, Stevie, Zach"
teamOneSet = teamOne.split(', ').to_set
teamTwoSet = teamTwo.split(', ').to_set
teamOneSet ^ teamTwoSet # => #<Set: {"John", "Zach"}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment