Compare commits

...

4 Commits

Author SHA1 Message Date
Tiago Collot fafaeae863 docs:(bezero): add missing space between line 5 and line 6 2 years ago
Tiago Collot 9864691922 docs(bezero): fix subject 2 years ago
Hamza elkhatri 6c79ce6310 Docs(bezero): Rewrite the title 2 years ago
hamza 7759b46272 DEV3202 add(Docs):add readme 2 years ago
  1. 42
      subjects/bezero/README.md

42
subjects/bezero/README.md

@ -0,0 +1,42 @@
## bezero
### Instructions
Write a function that takes a slice of integers as an argument and returns the same slice by initializing all the elements to 0.
- If the slice is empty, return an empty slice.
### Expected function
```go
func BeZero(slice []int) []int {
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(piscine.BeZero([]int{1, 2, 3, 4, 5, 6}))
fmt.Println(piscine.BeZero([]int{}))
}
```
And its output:
```console
$ go run .
[0 0 0 0 0 0]
[]
```
Loading…
Cancel
Save