Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete task #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Complete task #101

wants to merge 2 commits into from

Conversation

lnestor
Copy link

@lnestor lnestor commented May 10, 2018

@jaybobo
Here you go!

Copy link
Member

@jaybobo jaybobo left a comment

Choose a reason for hiding this comment

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

Looks good. See notes.

'D'
elsif integer < 60
'F'
end
end

def shortest_string(array)
Copy link
Member

Choose a reason for hiding this comment

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

there's a few ways in ruby to complete this in a more concise way. try this one again using .min_by.
https://ruby-doc.org/core-2.5.0/Enumerable.html#method-i-min_by

letsdrill.rb Outdated

#Put your code here!

if integer >= 90
Copy link
Member

Choose a reason for hiding this comment

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

if >= isn't sufficient and you need a 'lower bound', you can also use ranges

example:

case integer
when 80..90
  ...
end

@lnestor
Copy link
Author

lnestor commented May 11, 2018

I made the changes you recommended.


#Put your code here!

array.min_by(&:length)
Copy link
Member

Choose a reason for hiding this comment

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

💯

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