Browse Source

subject(skip-the-line):add readme

1277-skiptheline
hamza 2 years ago
parent
commit
aa0d6ec508
  1. 38
      subjects/skiptheline/README.md

38
subjects/skiptheline/README.md

@ -0,0 +1,38 @@
## skip-the-line
### Instructions
Write a function that receives a string and a slice of strings. Return a new slice with the given string prepended.
### Expected function
```go
func SkipTheLine(s string, slice []string) []string {
// your code here
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import "fmt"
func main() {
fmt.Println(SkipTheLine("Hello", []string{"world"}))
fmt.Println(SkipTheLine("Hello", []string{"","world", "!"}))
fmt.Println(SkipTheLine("Hello", []string{}))
}
```
and the output should be:
```console
$ go run .
[Hello world]
[Hello world !]
[Hello]
```
Loading…
Cancel
Save