mirror of https://github.com/01-edu/public.git
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.
miguel
7b50c69f22
|
9 months ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
main.go | 9 months ago |
README.md
weareunique
Instructions
Write a function that takes two strings
's and returns the number of characters that are not included in both, without repeating characters.
- If there is no unique characters return
0
. - If both strings are empty return
-1
.
Expected function
func WeAreUnique(str1 , str2 string) int {
}
Usage
Here is a possible program to test your function:
package main
import (
"fmt"
)
func main() {
fmt.Println(WeAreUnique("foo", "boo"))
fmt.Println(WeAreUnique("", ""))
fmt.Println(WeAreUnique("abc", "def"))
}
And its output:
$ go run .
2
-1
6