I'd like to add that not adding the 'return' is more idiomatic Ruby (& also following the Ruby style guide, see https://rubystyle.guide/#no-explicit-return).
yep, but it's optional
Ruby has an implicit return for the last statement in methods.
nope, not in ruby
Don't you need to put 'return' in order to use the function properly elsewhere?
Good point. Thanks!
This comment is hidden because it contains spoiler information about the solution
Agreed: Since the description mentions that only valid input will be used and the tests being exhaustive (i.e. checking all months in a year), random tests aren'T needed.
oh i see! Thank you!
In cases ilke this, I mostly put the parentheses in to remind myself about the precedence of the '' (in partucular).
i want to ask why there should be ()? i tried without them and it still works but i don't understand their meanings
Too complicated ;-)
please can someone explain what this syntax does?
This isn't an issue, you can print the inputs.
Any error will do.