Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strings"
- )
- func main() {
- a := input1()
- b := input2()
- n := len(a)
- result := []int{}
- for i := 0; i < n; i++ {
- if len(a[i]) != len(b[i]) {
- result = append(result, -1)
- }
- for _, letter := range a[i] {
- b[i] = strings.Replace(b[i], string(letter), "", 1)
- }
- result = append(result, len(b[i]))
- fmt.Println(a[i], b[i], len(b[i]))
- }
- fmt.Println(result)
- }
- func input1() []string {
- return []string{
- "a",
- "abb",
- "kj",
- "tea",
- "okk",
- "op",
- "xxxy1",
- }
- }
- func input2() []string {
- return []string{
- "bb",
- "abc",
- "jk",
- "toe",
- "koo",
- "mn",
- "xxxy2",
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement