forked from root/public
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
659 B
659 B
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
func ZipString(s string) string {
}
Usage
Here is a possible program to test your function :
package main
import (
"fmt"
"piscine"
)
func main() {
fmt.Println(piscine.ZipString("YouuungFellllas"))
}
And its output :
$ go run .
1Y1o3u1n1g1F1e4l1a1s
$