|
|
@ -7,22 +7,21 @@ |
|
|
|
- The function can return the numbers in any order. |
|
|
|
- The function can return the numbers in any order. |
|
|
|
|
|
|
|
|
|
|
|
- The number must be separated by a comma and a space. |
|
|
|
- The number must be separated by a comma and a space. |
|
|
|
|
|
|
|
|
|
|
|
- If any of the arguments is bigger than 99 or less than 0, the function returns `"invalid"` followed by a newline (`'\n'`). |
|
|
|
- If any of the arguments is bigger than 99 or less than 0, the function returns `"invalid"` followed by a newline (`'\n'`). |
|
|
|
|
|
|
|
|
|
|
|
- Add `0` at the first of any number if it is less than 10. |
|
|
|
- Add `0` at the first of any number if it is less than 10. |
|
|
|
|
|
|
|
|
|
|
|
- Add a new line (`'\n'`) at the end of the string. |
|
|
|
- Add a new line (`'\n'`) at the end of the string. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Expected function |
|
|
|
### Expected function |
|
|
|
|
|
|
|
|
|
|
|
```go |
|
|
|
```go |
|
|
|
func FromTo(from int, to int) string { |
|
|
|
func FromTo(from int, to int) string { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Usage |
|
|
|
### Usage |
|
|
|
|
|
|
|
|
|
|
|
Here is a possible program to test your function : |
|
|
|
Here is a possible program to test your function : |
|
|
@ -41,6 +40,7 @@ func main() { |
|
|
|
fmt.Println(FromTo(100, 10)) |
|
|
|
fmt.Println(FromTo(100, 10)) |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
And its output : |
|
|
|
And its output : |
|
|
|
|
|
|
|
|
|
|
|
```console |
|
|
|
```console |
|
|
|