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.
Hmmm that's weird, I'll look into it soon.
Thanks for your report :)
It seems to me that your algorithm is flawed - you do not perform a swap every single time regardless of conditions.
Take the list
[103, 87, 113]
for example:103
and87
. Since103
is indeed greater than87
we perform a swap.[87, 103, 113]
and we compare103
and113
. We only perform a swap if the number at the left hand side (103
) is greater than the number at the right hand side (113
). Since that is not the case, we do not perform a swap.[87, 103, 113]
.Hope that helps :)
My solution works only on 11 examples, and on 12th:
Input: [ 103, 87, 113 ]
writes to me this note: ✘ Expected: [87,103,113], instead got: [87,113,103]
Why it happens? Maybe I don't understand the task exactly?
Working examples:
Input: [ 25, 16, 9 ]
Output: [16,9,25]
Input: [ 17, 5, 11 ]
Output: [5,11,17], etc...
The output frame lights with green, but it writes that I have 1 Error, but I haven't nothing in console
I agree with upper comment, check both: null and length == 0