Compare commits

...

2 Commits

Author SHA1 Message Date
Mohamed Zaboub 86fedc138c add(subjects): issamestring subject 2 years ago
Mohamed Zaboub d240d5614e add(subjects): zipstring exercice subject 2 years ago
  1. 43
      subjects/issamestring/README.md
  2. 41
      subjects/zipstring/README.md

43
subjects/issamestring/README.md

@ -0,0 +1,43 @@
## issamestring
### Instructions
Write a function that returns `true` if the two `strings` passed as parameter are equal. Otherwise it returns `false`.
The function will ignore the case of the characters.
### Expected function
```go
func IsSameString(s1, s2 string) bool {
}
```
### Usage
Here is a possible program to test your function :
```go
package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(piscine.IsSameString("hello world!", "HELLO WORLD!"))
fmt.Println(piscine.IsSameString("0101 is awesome", "0101 is AWESOME"))
fmt.Println(piscine.IsSameString("foo baz", "foo bar"))
}
```
And its output :
```console
$ go run .
true
true
false
```

41
subjects/zipstring/README.md

@ -0,0 +1,41 @@
## zipstring
### Instructions
Write a function that takes a `string` and returns a new string that replaces every character with the number of duplicates and the character itself, deleting the extra duplications.
The letters are from the Latin alphabet list only, any other characters, symbols or empty spaces shall not be tested.
### Expected function
```go
func ZipString(s string) string {
}
```
### Usage
Here is a possible program to test your function :
```go
package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(piscine.ZipString("YouuungFellllas"))
}
```
And its output :
```console
$ go run .
1Y1o3u1n1g1F1e4l1a1s
$
```
Loading…
Cancel
Save