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.
ruby should be updated to version 3
Absolutely no need giving an array as input. Integer
n
would suffice.A little too late, but because join returns a string, it doesn't transform the array to a string.
For each language:
This comment is hidden because it contains spoiler information about the solution
Nice kata, thx!
The Ruby version of this Kata has no random testing whatsoever and as such can be passed by returning a constant string. No other language versions suffer from this issue.
I'm sorry, I should have been more clear.
First, let me say that I am commenting on the Ruby translation. The JS translation does not seem to have this issue, as the description specifies the numbers you receive will vary ("1 through 10 or less").
The issue is not that the input does not change; the issue is that, for all stated possible input values, the return value of the function will be the same.
In languages other than JS, you will receive the same 10 numbers in an array every time. Sorting these different inputs will always result in the same array. This means that the solution will ALWAYS be to simply return the following string:
"10 9 8 7 6 5 4 3 2 1 liftoff!"
Thus, a valid solution can safely ignore the input parameter. Having the parameter be there at all seems intentionally misleading.
If the other translations worked the same as a JS solution, where the given numbers were not always 1 through 10, this would not be an issue.
use
console.log(input)
to see the inputs and you will notice they are randomly generated :)How does it vary based on input? What input could you give to the function that would return a different string?
resolved
That should be suggestion not issue.
resolved
That should be a question, not an issue.
That should be a question , not an issue.
Loading more items...