-
Completed at: 2023-07-10T17:23:04.517Z
-
Completed languages: javascript
-
Tags: Fundamentals
-
Rank: 8 kyu
Build a function that returns an array of integers from n to 1 where n>0
.
Example : n=5
--> [5,4,3,2,1]
*NOTE: In NASM, the function signature is* `int *reverse_seq(int n, size_t *size)` *where the first parameter* `n` *is as described above and the second parameter* `size` *is a pointer to an "out" parameter which should be set to the size of the array your function returns (which should be equal to* `n` *if your implementation is correct).*
RISC-V: The function signature is
```c
void n_to_1(int n, int *arr);
```
Write your result to `arr`. You may assume it is large enough to hold the result. You do not need to return anything.