-
Notifications
You must be signed in to change notification settings - Fork 91
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
base: master
Are you sure you want to change the base?
Complete task #101
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
I made the changes you recommended. |
|
||
#Put your code here! | ||
|
||
array.min_by(&:length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@jaybobo
Here you go!