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.
a < b
is the same asb > a
.Also, map is faster than inject, so I agree that it's not the best solution.
Huh, apparently .to_i converts the first number it can find in a string
this kata is about (.sub) and (.gsub).... not (.tr) !!
Use tr when you want to replace (translate) single characters.
Use gsub when you need to use a regular expression or when you want to replace longer substrings
Why is it best practice to use .tr method here? Thanks for the great submission :D
I thought you were just supposed to debug it LOL
spoiler flag, plz...
This comment is hidden because it contains spoiler information about the solution
elegant.
@aerotune @travelerspb I see what you mean. I appreciate that not mutating the original string is better, I added a new solution here: http://www.codewars.com/kata/reviews/55f20b5169b42aa91b0000dc/groups/5b1ccdb7777ab7180e000130
What I strive for is to go the 'confident ruby' way of narrative code, where managing the input is clearly distinguished from the work performed on that input.
Thanks for your comments!
definetely a bad practice
stop, but what about - "Your points are not included in the array of your classes points. For calculating the average point you may add your point to the given array!"?
only if the possible points can be a float or the boundary is changed to be inclusive
Don't you need to make the average a float?
Loading more items...