Last active
August 29, 2015 14:26
-
-
Save mendelB/e079a989652d5c5a4362 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
sentence = <<-something | |
Steven likes the movies. Blake likes to ride his bike but hates movies. | |
Blake is taller than steven. Steven is a great teacher. | |
something | |
counter = Hash.new(0) | |
sentence.gsub('.', '').split(' ').each do |i| counter[i] += 1 end | |
counter.each do |k, v| puts "'#{k}' appears #{v} times" if v >= 3 end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment