Created
December 12, 2017 21:32
-
-
Save dbhalling/53eb4622de95dbee99aee99d31918b8e to your computer and use it in GitHub Desktop.
#CamelCase
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
#CamelCase | |
s = "saveChangesInTheEditor" | |
def solution(s) | |
sa = s.chars | |
sa.keep_if {|v| v =~ /[ABCDEFGHIJKLMNOPQRSTUWXYZ]/} | |
count = sa.count + 1 | |
return count | |
end | |
puts "The number of words in the string is #{solution(s)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment