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.
 
 
 
 
 
 

51 lines
558 B

package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) != 3 {
return
}
first := os.Args[1]
second := os.Args[2]
if first == "" {
fmt.Println("1")
return
}
if second == "" {
fmt.Println("0")
return
}
i := 0
j := 0
count := 0
firstA := []rune(first)
secondA := []rune(second)
for i < len(first) {
for j < len(second) {
if firstA[i] == secondA[j] {
count++
i++
}
if i == len(first) {
break
}
j++
}
i++
}
if count == len(first) {
fmt.Println("1")
} else {
fmt.Println("0")
}
}