Skip to content

Latest commit

 

History

History

reversed-sequence

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
  • Completed at: 2023-07-10T17:23:04.517Z

  • Completed languages: javascript

  • Tags: Fundamentals

  • Rank: 8 kyu

Description

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.