Created
August 16, 2016 21:34
-
-
Save alexgriff/e2d90eaa1c67fdc626fc125d421de47b to your computer and use it in GitHub Desktop.
This file contains 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 count_letters(sentence) | |
end | |
# count_letters("hello hi") | |
#=> {'h'=> 2, "e"=> 1, "l"=> 2, "o" => 1, " "=> 1, "i"=> 1} | |
def has_2?(collection, element) | |
end | |
# has_2?(["a", "b", "x", "a"], "a") #=> true | |
# has_2?(["a", "b", "x", "a"], "x") #=> false | |
def has_n?(collection, element, n) | |
end | |
# has_n?(["a", "b", "x", "a"], "a", 2) #=> true | |
# has_n?(["a", "b", "x", "a"], "a", 3) #=> false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment