Browse Source

docs(zipstring): fix subject

- upgrade instructions
- added more possible outputs
- removed extra spaces
pull/1354/head
Tiago Collot 2 years ago committed by Michele
parent
commit
03d5b77c66
  1. 15
      subjects/zipstring/README.md

15
subjects/zipstring/README.md

@ -2,9 +2,9 @@
### 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.
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.
- The letters are from the latin alphabet list only. Any other character, symbols, shall not be tested.
### Expected function
@ -16,7 +16,7 @@ func ZipString(s string) string {
### Usage
Here is a possible program to test your function :
Here is a possible program to test your function:
```go
package main
@ -27,15 +27,18 @@ import (
)
func main() {
fmt.Println(piscine.ZipString("YouuungFellllas"))
fmt.Println(ZipString("YouuungFellllas"))
fmt.Println(ZipString("Thee quuick browwn fox juumps over the laaazy dog"))
fmt.Println(ZipString("Helloo Therre!"))
}
```
And its output :
And its output:
```console
$ go run .
1Y1o3u1n1g1F1e4l1a1s
1T1h2e1 1q2u1i1c1k1 1b1r1o2w1n1 1f1o1x1 1j2u1m1p1s1 1o1v1e1r1 1t1h1e1 1l3a1z1y1 1d1o1g
1H1e2l2o1 1T1h1e2r1e1!
$
```

Loading…
Cancel
Save