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.
It'll run as long as you don't change the function name in the initial code.
This kata is 9 years old, quality reviewing in the beta was not strong at the time.
I tried to be more mathematically exact in the description. Could you please check if it is more clear now or suggest some further improvements?
Updated to Python 3.11, but your solution is not sufficiently fast.
No. The output should be screen size, not the ratio. A 32x8 screen is not equivilent to a 4x1 screen.
That's a problem with your code, not with the tests. Delete that line.
Seems correct to me. ex "love", first letter "l" and last letter "e" dont change, "ov" sorted alphabetically is, well, "ov".
You're the one keep protesting against test data that is intended to be
[solution, input]
but you misinterpret it as[input, solution]
.You need to observe the basic test code carefully:
You can see that the first item of the list is intended to be the solution, not the input. The input is the second item. The test has handle this correctly, it puts the second item (the input) to function, and check whether it matches the solution (first item).
Again, if you don't like the test order of
[solution, input]
, fork the kata -> edit the fork -> submit.It is not an error. People have different perspective of how the tests should be managed. It doesn't have to be in the order of
[input, solution]
. Although, yes that can make some people be confused of the test, the one that wrote the python translation wanted it[solution, input]
, so be it. The test still working fine right? It's a weird thing making it a reason to label it as an error.If you don't like it, you can just fork the kata, edit it, submit it, and wait for approval.
If you print out the array in your function, you may see for yourself what is being passed in, and if it is already sorted or not. You may also try returning a hardcoded answer for the first testcase and see what passes and what fails.
Uh... not really. The code goes:
for exp, inp in tests: ...
, meaning the first list is the expected result, and the second one is input. It's a bit strange, sure, but it still works.Could you rephrase this? I don't understand what's the problem here.
This comment is hidden because it contains spoiler information about the solution
That means you are returning more than 2 lists.
Yes, it's a problem with your code. Sometimes you're adding a number greater than p there. Please mark your post as having spoiler content next time.
I tried your solution which passed without problem.
Loading more items...