Files
LeetCode-Go/leetcode/0856.Score-of-Parentheses/856. Score of Parentheses_test.go
2020-08-27 00:58:22 +08:00

67 lines
845 B
Go

package leetcode
import (
"fmt"
"testing"
)
type question856 struct {
para856
ans856
}
// para 是参数
// one 代表第一个参数
type para856 struct {
one string
}
// ans 是答案
// one 代表第一个答案
type ans856 struct {
one int
}
func Test_Problem856(t *testing.T) {
qs := []question856{
{
para856{"()"},
ans856{1},
},
{
para856{"(())"},
ans856{2},
},
{
para856{"()()"},
ans856{2},
},
{
para856{"(()(()))"},
ans856{6},
},
{
para856{"()(())"},
ans856{3},
},
{
para856{"((()()))"},
ans856{8},
},
}
fmt.Printf("------------------------Leetcode Problem 856------------------------\n")
for _, q := range qs {
_, p := q.ans856, q.para856
fmt.Printf("【input】:%v 【output】:%v\n", p, scoreOfParentheses(p.one))
}
fmt.Printf("\n\n\n")
}