Skip to content

Instantly share code, notes, and snippets.

@samueldowens
Last active December 24, 2015 21:49
Show Gist options
  • Select an option

  • Save samueldowens/6868143 to your computer and use it in GitHub Desktop.

Select an option

Save samueldowens/6868143 to your computer and use it in GitHub Desktop.
anagrams.rb
class Anagram
def initialize(word)
@name = word
end
def match(array)
matched = []
array.each do |string|
if string.chars.sort == @name.chars.sort
matched << string
end
end
matched
end
end
@samueldowens

Copy link
Copy Markdown
Author

cleaned up the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment