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.
Yeah, I feel best practice is to use memoization, and that honestly feels beyond 5 Kyu-knowledge.
I like your sete. Good thinking!
Didn't know I could test it that way, nor did it occur to me - thanks!
This is interesting, because "Fixed tests" and "Small strings tests" should present you the input of failing tests.
Sample tests (the ones run when you click TEST) do not present inputs, but you can add and remove test cases and assertions to see which one trips up your solution.
In your case, it's this one:
assert.strictEqual(scramble('katas', 'steak'), false);
JS: My code passes all large tests, but fails a basic one with the error output only showing "Expected true to equal false" - any ideas?
I found my mistake. Keep an eye on your register sizes. I started with 8bit regs, and only switched to 64bit regs when I saw the random long str test. I simply forgor to change 1 line to get a 64bit value and not only 8bit.
This comment is hidden because it contains spoiler information about the solution
NASM. My code solves all BasicTests and RandomTests. TestsStringsUpTo40kLenForPerfomanceAssesment then fails on the first tested string pair. It is not a time out, it says "Incorrect answer for". Any ideas for potential pit falls when handling these very long strings?
Approved by someone
NASM translation Please have a look at it.
In addition to monadius note. I tried malloc before and I got a sigsegv. I doubted malloc at that point, but it was a special case that caused this crash. So for anyone else struggling, watch out for special test cases. There is a sneaky one.
Thanks for the clarification. For some reason I expected that it is intended to use the RDI-pointer not only for the length but also for the result arr. Have a nice day.
The result is a dynamically allocated (e.g., with
malloc
) array. The address of this array should be returned inrax
. The length of this array should be written into[rdi]
.I recommend to solve this kata in C first because the C version has the same requirements as NASM.
Another thanks for your explanation and your provided link. Have a nice day.
Loading more items...