From d240d5614ea927e52ec2034795bd85c6b3705442 Mon Sep 17 00:00:00 2001 From: Mohamed Zaboub Date: Wed, 8 Jun 2022 10:36:31 +0100 Subject: [PATCH] add(subjects): zipstring exercice subject --- subjects/zipstring/README.md | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 subjects/zipstring/README.md diff --git a/subjects/zipstring/README.md b/subjects/zipstring/README.md new file mode 100644 index 00000000..10383b58 --- /dev/null +++ b/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 +$ +```