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.
done + for BF too
JS needs to have Mocha/Chai instead of CW's Test one (see the docs for more information)
Thanks! My solution works!
I've recently made some changes to this kata.
Try the following steps to see if your issue is resolved.
Copy your solution to somewhere safe
Press the
Reset
button in the trainer (located at the bottom)Paste your solution back in the solution window & press the
Attempt
/Test
button.Im getting this error message when I attempt with Javascript:
ReferenceError: SubstringTest is not defined
at /home/codewarrior/index.js:24:63
at /home/codewarrior/index.js:70:5
at Object.handleError
I dont think there is anything I can change prevent the error. I dont have access to index.js.
My solution passes the test cases and works in my IDE.
Enabled Node v18 & camelCased function name (with backward compactibility) in this fork
Enabled in this fork
i added a fixed test for
n == 0
and a guardif (n == 0) return 0;
in the reference solutionWith C translation, when I first edited & retried to see if I could remove my single-digit early-bailout check, right away, I got
n = 0
in a random test. I still returned0
but it failed expecting2^32-1
or similar. I tried another handful of times and it didn't reappear, but now I can see the reference solution, and I think it needed to not be able to return-1U
.There is no mention in the challenge description on whether all the strings passed to the program contain exclusively ASCII characters or whether other unicode symbols are possible. I worked under the assumption that the function only has to work with ASCII and the tests ended up passing, but adding this to the challenge description would be nice for low-level languages like C, C++, Rust, ...
Lua translation!
chrono is the goat
Because those are different indices, 1 and 5 (6 - 1). If you really wanted to use index 1, to the left, the sum is 1 and to the right, 9, and that's not a valid solution.
This comment is hidden because it contains spoiler information about the solution
Loading more items...