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.
No reason behind. But Javascript does have a Issue with the sorting algorithm if revenue is the same. so we included it into the Testcases.
@fnbro why make up new fixed tests cases rather than use the same ones from the Python translation? There's no point in test suite disparity between the two languages.
Why are your tests different between JS and Python translations? The translations have different sets of fixed tests...
Yeah, that's strange... because I just ran my code in browser and it works great
Don't know why it returns different arrays here and in my console...
P.S. And my code works perfectly in Codepen too
Thanks for the answer anyway, I guess I should just skip this kata..
It doesn't, have you read the error message?
The question is same.
My code returns [ "Tablets", "Music CDs", "Speakers" ].
-Because Speakers goes BEFORE Keyboards.
-In my answer Speakers goes BEFORE keyboards
-This is their ORIGINAL positions.
Why in the world would test expect KEYBOARDS?
And what's the question? Your logic is correct, the only thing that's left is to make your code correct too.
So, I have these arguments in my JavaScript function:
products: [ 'Tablets', 'Computer', 'Vacuum Cleaner', 'Mouses', 'Scooter', 'TVs', 'Speakers', 'Keyboards', 'Printer', 'Games', 'Chargers', 'Cell Phones', 'Music CDs', 'Drones' ]
amounts: [ 40, 27, 12, 3, 12, 44, 22, 44, 17, 13, 1, 19, 22, 19 ]
prices: [ 88, 66, 67, 63, 61, 6, 84, 42, 1, 22, 68, 72, 94, 24 ]
And the test expected [ 'Tablets', 'Music CDs', 'Keyboards' ] to deeply equal [ 'Tablets', 'Music CDs', 'Speakers' ]
Keyboards and Speakers has the same revenue: 1848, and you requested order them according to their original positions.
Speakers goes before Keyboards in input parameters. So wtf does this thing want?
Oh, sure, I forget about bills I can't split
Thanks
Read the instructions again and some of the many posts down here. Also, the log appears above the test result, so it seems you're confusing the result of one test with the log of the next one.
'YES' should equal 'NO'
Log
[25, 50, 100, 25, 25, 25, 50]
25
25
not enough cash
NO
Sorry, what
My result IS 'no', but ofc 'yes' should equals 'no'
Sorry, you're right, I had misread the instructions. Thanks!
yes, he asked same question two places, (already answered), the test is correct
Try with this:
is there any way to see the input in the failed tests?
I havent found a way to see them in Go
Loading more items...