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.
This comment is hidden because it contains spoiler information about the solution
There is an error in this test. Something was deppreciated.
Hi,
I am not sure if your code is right or wrong. But having just solved this Kata in Ruby, you need to write your own test cases in order to pass the kata, so it may be worth checking out the test cases and updating them.
Cheers
Hi :)
Can someone direct me towards info about what is being done in this exercise?
I am not sure if I am being able to follow it, or even sure if I understand what I am looking at to begin with..
Thank you :)
Hello :) can someone help me on what I am doing wrong with my code please?
Thank you very much
function solution(nums){
if (nums == null) {
return [];
} else {
return nums.sort(function(a, b) {return b-a});
}
}
Thank you so much for your help!
I still had to add an if element in order to make it work, but without your help I would still be scratching my head xD
probably not an at all clean code, but I made it haha
Thank you.. That is a really clear and simple explanation..
An array of length 2 has indexes 0 and 1, so if you do
i<= arr1.length
, it will try to accessarr1[2]
and you'll get an out of bounds error.This comment is hidden because it contains spoiler information about the 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