Compare commits

...

10 Commits

Author SHA1 Message Date
zainabdnaya b0400cdd1f corrected 2 years ago
zainabdnaya def935f019 subject 2 years ago
zainabdnaya c3fe6c04d1 add test 2 years ago
zainabdnaya 265fd1c5c5 add test 2 years ago
zainabdnaya 0a5b2b65f2 add test 2 years ago
zainabdnaya cc90dabfad add test 2 years ago
zainabdnaya 57d02fb123 subject 2 years ago
zainabdnaya d0b3c7cd61 add test 2 years ago
zainabdnaya d8ddc77a58 Unzipstring function 2 years ago
zainabdnaya 0e3c46ad54 Unzipstring function 2 years ago
  1. 57
      subjects/unzipstring/README.md

57
subjects/unzipstring/README.md

@ -0,0 +1,57 @@
## Unzipstring
### Instructions
write a function named `Unzipstring` that takes a string in form of a number and printable character that is not a number and returns the original string.
- the number before the alphabet should be between 0 to 9
- The one alphabet after each number should be between a to z or A to Z
- it can be two numbers or two alphabets in a row
- if the Input string doesn't respect the format return `Invalid Input`
### Expected Function
```go
func Unzipstring(s string) string {
//code here
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import (
"fmt"
)
func main() {
fmt.Println(Unzipstring("2f"))
fmt.Println(Unzipstring("2O5u2H0e"))
fmt.Println(Unzipstring("3p6i1W"))
fmt.Println(Unzipstring("6H8a"))
fmt.Println(Unzipstring("2p4;7g"))
fmt.Println(Unzipstring("2a 6p8f"))
fmt.Println(Unzipstring("2t4dD"))
fmt.Println(Unzipstring("82t4D"))
fmt.Println(Unzipstring(""))
}
```
And its output :
```console
$ go run .
$ff
$OOuuuuuHH
$pppiiiiiiWWW
$HHHHHaaaaaaaa
$pp;;;;ggggggg
$Invalid Input
$Invalid Input
$Invalid Input
$Invalid Input
```
Loading…
Cancel
Save