Skip to content

Instantly share code, notes, and snippets.

@sugi1119
Created September 16, 2014 06:58
Show Gist options
  • Save sugi1119/3e3a1857fefb4ed86429 to your computer and use it in GitHub Desktop.
Save sugi1119/3e3a1857fefb4ed86429 to your computer and use it in GitHub Desktop.
ruby monk problems
def find_frequency(sentence, word)
sentence.downcase.split.count(word.downcase)
end
sentence = "hello hello the world"
word = "hello"
puts find_frequency(sentence, word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment