Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Interesting, can you share example what RDMS do not support column alias?
Sorry if it looks like I carp on you or your solution, It's not. I just want to learn from your solution.
Thanks
I like your solution, but did you think that referencing a column by order is a good practice?
Hi!
Look, this:
returns
true
orfalse
.This means you don't need the if/else statement.
Without if/else statement your solution is much better.
Nice!
Do you consider to create another function and construct whole song there? So it become posible in
hq9
:Is it too dificult for 8kyu level kata?
This comment is hidden because it contains spoiler information about the solution
your even method can be simplified to:
because
#==
method returns boolean true or false.And as you may already mention Intergers in Ruby has
#odd?
and#even?
methods.Guys please note that in Ruby language
get_sum
method is bad style for method name. Justsum
orsum_of
orsum_of_two
is much cleaner. No need for prefixes likeget_
orset_
.