Last active
March 12, 2019 01:34
-
-
Save barnes7td/94953b9c2415ae909ec2 to your computer and use it in GitHub Desktop.
Job Prep Same Number
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
# Create a method same_number? that takes a string of x's and o's and determines | |
# if there are the same number of x's as o's. "xooxxxxooxo" has more x's and | |
# therefore would return false. "xxooxxooxoxo" has the same amount of x's and o's, | |
# therefore would return true. | |
def same_number?(str) | |
end | |
same_number?("xooxxxxooxo") | |
#=> false | |
same_number?("xxooxxooxoxo") | |
#=> true | |
same_number?("xooxxxxooxooo") | |
#=> false | |
same_number?("xxooxxooxoxooxoxooxx") | |
#=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment