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.
Where i was wrong?
Program is:
mov a, 11 ; value1
mov b, 3 ; value2
call mod_func
msg 'mod(', a, ', ', b, ') = ', d ; output
end
; Mod function
mod_func:
mov c, a ; temp1
div c, b
mul c, b
mov d, a ; temp2
sub d, c
ret
My output is 0, but should be 2. How i know i am right but i have error there
What's wrong? It's working.
Yes, it is
You can do it better:
def prod(arr):
if arr:
return max(accumulate(arr, mul))
return 1
You also can change number*-1 to -number