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.
Chess grid is not part of input, and you do not have to build it.
You do not need the whole board to solve this kata.
Do we have to build the chess board grid? or is it already part of the data for the Kata?
This comment is hidden because it contains spoiler information about the solution
I'm reading the Kata's description in English.
https://www.etymonline.com/word/-teen
There's the origin of the word "teen"
"Ten, Eleven, Twelve" does not end in "teen".
thirTEEN does...
This is common knowledge... correct?
Thank you
This comment is hidden because it contains spoiler information about the solution
Beautiful wizardry
Thank you for responding.
If you'll notice my update on the same day as my post, I realized why my tests were passing. My output was being printed in the browser innerHTML which was auto deleting the whitespace. I didn't notice the difference between that and the console output.
Thanks again
I am not sure what it would mean. What kind of incorrect handling would the editor do?
I have some problems understanding what "it" would be, but tests are not doing anything to anything, other than invoking your solution and comparing it with an expected answer.
It's difficult for me to believe. Your code does indeed not solve the task of the kata correctly, and there's no chance it would pass tests anywhere else, unless they are not exhaustive enough and test only some subset of scenarios. It's enough to study sample tests to notice what's the difference between your results and expected results.
Focus on sample tests, especially on the test case with input of
"AWUBWUBWUBBWUBWUBWUBC"
, see what your solution returns, what is expected answer, and what it returns in other editors.I told you, the first test passes, the second one doesn't, and it won't pass in any editor, your code doesn't replace multiple WUBs with only one space. Try using something like this to see it: http://pythontutor.com/javascript.html#mode=edit
Why is it wrong? I don't think it's a kata issue as much as an issue of how the codewars editor handles the code. BTW, some tests that fail here pass in repl.it.
Also all the tests I've done pass in VSCODE with live server, Also my code passes on w3schools editor, and at Code Playground.
I'd really like to learn from this, but I need to know the "why".
Thanks
::UPDATE:: You're right - it logs incorrectly in the other ones too.
But it prints to innerHTML correctly. That was my mistake and overlooking the fact that those two checks were different.
Still not sure why it needs the extra step.
Thanks a lot for your time
Your code is wrong, and it fails in repl.it too.
If you add a
console.log(arr)
before the return line, you'll see this:['A', '', '', 'B', '', '', 'C']
When your code returns undefined, you
console.log
the first test, which works and shows you a single space between letters, when you return, the second test fails.Not a kata issue.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...