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.
the initial code has been adapted
Thanks, worked
the input matrix should be
const
-qualified in C:the input is a matrix:
int **
, i.e. an array of 8-byte pointers to 4-byteint
.[rdi]
gives you the (address of the) first row of the matrix, not the first element of the first rowI dont get where array pointer in NASM.
; <-- RAX sumofmin(ro [qword [dword RDI]] nums, RSI rows, RDX cols) -->
So
[rdi]
should be first item in array?I even did some function to print values in STDERR and everything worked fine but for
[rdi]
.Code i did and even checked on my machine works and would here too i believe if i could get this array.
Lua translation!
Fixed.
No random tests in Swift
Insufficient info, closing
Go Translation!
What language are you using? What bug have you experienced?
There's an bug in the initial solution.
For some reason, the random tests in the C# translation almost never fail, and you can return pretty much anything. I was able to submit a solution that has hard-coded return values for the three visible test cases, and just returns 0 for all other tests:
https://www.codewars.com/kata/reviews/5e5904021cff490001cdb237/groups/64ca1a6ca9a9ec0001fc2fb8
I'm still confused about arrays in C and assembly, I had some trouble with this.
In C it behaved like a standard 2D array, but in NASM I had to dereference rdi to get a pointer to the array. (I expected rdi to point to the first element in the array).
Is this what usually happens?
You're removing those numbers from the input, so, when the control function calculates its sum, it's using the other numbers:
136 + 128 + 83 = 347
Anyways, I've changed the tests so the expected value is computed first and your code messing with the input isn't a problem anymore, but be aware of that.Loading more items...