You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
## reverserange
|
|
|
|
|
|
|
|
### Instructions
|
|
|
|
|
|
|
|
Write the function `ReverseRange` which must:
|
|
|
|
|
|
|
|
- allocate (with make()) an array of integers.
|
|
|
|
- fill it with consecutive values that begin at `end` and end at `start` (Including `start` and `end` !)
|
|
|
|
- and that returns that array.
|
|
|
|
|
|
|
|
### Expected function
|
|
|
|
|
|
|
|
```go
|
|
|
|
func ReverseRange(start, end int) []int {
|
|
|
|
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Usage :
|
|
|
|
|
|
|
|
- With (1, 3) the function will return an array containing 3, 2 and 1.
|
|
|
|
- With (-1, 2) the function will return an array containing 2, 1, 0 and -1.
|
|
|
|
- With (0, 0) the function will return an array containing 0.
|
|
|
|
- With (0, -3) the function will return an array containing -3, -2, -1 and 0.
|