Skip to content

Ruby refresher done#2

Open
fabienalbi wants to merge 11 commits intoParisRubyWorkshop:masterfrom
fabienalbi:master
Open

Ruby refresher done#2
fabienalbi wants to merge 11 commits intoParisRubyWorkshop:masterfrom
fabienalbi:master

Conversation

@fabienalbi
Copy link

No description provided.

lib/questions.rb Outdated
# add all the keys and all the values together, e.g.
# {1 => 1, 2 => 2} becomes 6
def add_together_keys_and_values(hash)
hash.flatten.inject{ |sum, ele| sum += ele }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space missing to the left of {.

lib/questions.rb Outdated
hash_count[word.length] ||= 0
hash_count[word.length] += 1
end
return hash_count

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant return detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants