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.
26 lines
368 B
26 lines
368 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
5 years ago
|
func result(s1 string, s2 string) string {
|
||
5 years ago
|
var rest []rune
|
||
5 years ago
|
for _, a := range s1 {
|
||
|
for _, b := range s2 {
|
||
|
if a == b && !strings.ContainsRune(string(rest), a) {
|
||
|
rest = append(rest, a)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
}
|
||
|
return string(rest)
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
if len(os.Args) == 3 {
|
||
|
fmt.Println(result(os.Args[1], os.Args[2]))
|
||
|
}
|
||
|
}
|