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.
not the best solution and not very clever.
sum
for the result of the addition makes the code more self explenatoryThis comment has been reported as abusive
This comment has been reported as abusive
For anyone wondering, this is definitely and absolutely NOT best practice! Its not even a clever solution.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I think you dont even need to work of this edge case.
"abc"[1...-1] # => "b"
"ac"[1...-1] # => ""
"a"[1...-1] # => ""
Thats the only one that may be a problem
""[1...-1] #=> nil
i think its not a good Ruby practice to use the "return" keyword in the last statement