mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 01:15:57 +08:00
49 lines
776 B
Go
49 lines
776 B
Go
package leetcode
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type question884 struct {
|
|
para884
|
|
ans884
|
|
}
|
|
|
|
// para 是参数
|
|
// one 代表第一个参数
|
|
type para884 struct {
|
|
A string
|
|
B string
|
|
}
|
|
|
|
// ans 是答案
|
|
// one 代表第一个答案
|
|
type ans884 struct {
|
|
one []string
|
|
}
|
|
|
|
func Test_Problem884(t *testing.T) {
|
|
|
|
qs := []question884{
|
|
|
|
{
|
|
para884{"this apple is sweet", "this apple is sour"},
|
|
ans884{[]string{"sweet", "sour"}},
|
|
},
|
|
|
|
{
|
|
para884{"apple apple", "banana"},
|
|
ans884{[]string{"banana"}},
|
|
},
|
|
}
|
|
|
|
fmt.Printf("------------------------Leetcode Problem 884------------------------\n")
|
|
|
|
for _, q := range qs {
|
|
_, p := q.ans884, q.para884
|
|
fmt.Printf("【input】:%v 【output】:%v\n", p, uncommonFromSentences(p.A, p.B))
|
|
}
|
|
fmt.Printf("\n\n\n")
|
|
}
|