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.
You are so right my mistake!! I did not read enough thank you for pointing out!
No, your code is outputting the wrong answer. The input is
1021
, your code returns1201
, the correct answer is2110
. The task is not to reverse the number, read the description again.Test1021 is wrong the order is messed up for the test case.
Got confused with options. This was my first comment btw. Taking note of it.
Kata's description is fine, it tells you exactly what you need to do. If you have a suggestion about how to improve it, raise a suggestion, not an issue.
Problem description is not satisfactory. I had to look at the test cases when 'Attempting' to figure out the problem to be solved.
I don't say that it's the best description in the world, but to me it's quite clear that it wants digits in a descending order, and not numbers in a descending order. And it is the same as getting the highest possible number.
Would you have an idea for a better description?
Not your fault. The problem is written wrong. The first statement says to put them in reverse. The second statement says to re-arrange to get the biggest number.
This problem is misleading. It states to print out the numbers in descending order. That is false. What it is asking is to rearrange the numbers to get the biggest number possible from the number put into the function call. The first and second statements of the description are contradictory. The output fails if it doesn't completely re-arrange the numbers to get the biggest number.
Ahh, jeez. Thanks so much for your time ... rookie error there by me.
There is a typo in your solution, your function is named
decending_order
but it should bedescending_order
.Hi folks,
I'm very new to this so apologies if this is a foolish question.
I've built a solution which I belive works as intended, I've tested it with variations of integers and it seems to be working fine, until ... when I add the code into codewars and run it, a syntax error is thrown on this sample test:
test.assert_equals(descending_order(def), 987654321)
The error points to def.
I'd expect the test to read: test.assert_equals(descending_order(123456789), 987654321)
Is this an error with me or with the test?
thanks :*
Read this: https://docs.codewars.com/training/troubleshooting#expected-the-same
This comment is hidden because it contains spoiler information about the solution
Loading more items...