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.
Approved by someone
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.
See the message above.
This comment is hidden because it contains spoiler information about the solution
Your solution overwrites some existing values on stack. That's why you get different expected results for the same test case. I edited NASM tests. The failure message contains values of input parameters now so you don't need to print them.
I may be slightly confused, but what does RAX or R9 have to do with
malloc
call? When you callmalloc
, the argument is expected to be in RDI register, no? (I haven't solved this in NASM, so I can't check your code)This comment is hidden because it contains spoiler information about the solution