Created
September 16, 2014 06:58
-
-
Save sugi1119/3e3a1857fefb4ed86429 to your computer and use it in GitHub Desktop.
ruby monk problems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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