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.
Neat, didn't know you could do that - read the docs!
This comment is hidden because it contains spoiler information about the solution
Very good kata for practice !!! ;)
Same for me !!! Not good at all !!!
Can you guys help me , why doesn't my average function works :
class Array
def square
# create your square method here
self.map {|n| n ** 2}
end
def cube()
self.map {|n| n**3}
end
def average()
self.map ((sum.inject(0) { |z,x| sum + x }) / self.length)
end
def sum(x)
sum.inject(0){|sum,x| sum + x }
end
def even()
even.values_at(* even.each_index.select {|i| i.even?})
end
def odd()
odd() { return this.filter(odd(x) { return 0 == x % 2; }); }
end
now fill in the rest
end
when I tested it's giving "wrong number of agruments."