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.
4 years later, Node 18. is the one and only default version, closing this one
Appreciate it, thankyou!
This comment is hidden because it contains spoiler information about the solution
Those are two different cases and you should read this note:
There is your problem.
input '888a 999a'
Visual Studio Code (highest possible js version)
sort
withlocaleCompare
=> 888a 999aJS version 8 (highest possible js version for this very kata) => 999a 888a
I was wondering about this.. the problem describes this corner case but doesnt test for it when you submit? This code doesnt appear to handle that case.
Hello,
My Javascript code is failing for some random tests by the test set up here. However, this this giving correct answer in my personal compueter sublime editor. I am using eval function and for rounding to nearest integer I using Math.round().
Ex: 586c5 9x7711 885y8 761z3 3b896 87b7 6x98 d86475 100a0 9327a1 9206z3
Codewar showing : It should work for random inputs too - Expected: -84271, instead got: -80447
my own test environment showing : Result = -84271
Is there any idea what am I missing ?
Sort Update : I was using "localeCompare" function for string compare and now changed to string.prototype.charCodeAt() function for the comparision. BUt nothing changed in codewar. I am still failing here but passing in my own system.
Not an issue. Your logic is incorrect.
This comment is hidden because it contains spoiler information about the solution
@rowcased It's not about code not working on different versions, it's that the TESTS themselves aren't functional for specific one (because they're written poorly, and node 10 says no to that). Granted, there's no issues when attempting all test cases, this is a minor issue, but I'd rather see 2 lines added than see more issues raised from people who don't know how to deal with errors like this.
With that said, I do agree with what you're saying in principle.
Thank you. Yes, very silly of me.
I'm not so sure it is an issue? Doesn't seem fair to offer multiple nodes and expect a valid solution in one to work in all/others. It reminds me of criticism of functional Python 2 code where people say, "yeah, but this doesn't work in Python 3", whereas in many cases Python 3 had not been even been enabled at the time of the solving. Anyway, just my thoughts.
JavaScript Completions 2106
This is only node 10 issue, and it's only for the sample test. If you hit submit, it works fine. (try it with node 8 and it's gonna work)
It's because node 10 runner uses test framework that requires
describe
andit
blocks for tests (as far as I understand)But yes, it is an issue :/
As my own solution was not working, I unlocked the solution and tested couple of popular solution. However, they are too giving error,
"No output was produced.
Make sure tests are written properly using
describe
andit
(required for Node 10)."Has anyone successfully completed this kata using Javscript ?
Loading more items...