mirror of https://github.com/01-edu/public.git
zainabdnaya
2 years ago
committed by
José Rosendo
1 changed files with 56 additions and 0 deletions
@ -0,0 +1,56 @@
|
||||
## Weareunique |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that takes two strings and returns the amount of characters that are not included in both without doubles. |
||||
|
||||
- If there is no unique charachters return -1. |
||||
- If both strings are empty or one of them return -1. |
||||
|
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
|
||||
func Weareunique(str1 , str2 string) int { |
||||
|
||||
} |
||||
|
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
func main() { |
||||
|
||||
arr := [][]string{ |
||||
{"foo", "boo"}, |
||||
{"abc", "def"}, |
||||
{"hello", "yoall"}, |
||||
{"everyone", ""}, |
||||
{"hello world", "fam"}, |
||||
} |
||||
|
||||
for |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
$ go run . |
||||
1 |
||||
6 |
||||
4 |
||||
-1 |
||||
10 |
||||
$ |
||||
``` |
Loading…
Reference in new issue