mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 09:23:19 +08:00
规范格式
This commit is contained in:
57
leetcode/0394.Decode-String/394. Decode String_test.go
Normal file
57
leetcode/0394.Decode-String/394. Decode String_test.go
Normal file
@ -0,0 +1,57 @@
|
||||
package leetcode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type question394 struct {
|
||||
para394
|
||||
ans394
|
||||
}
|
||||
|
||||
// para 是参数
|
||||
// one 代表第一个参数
|
||||
type para394 struct {
|
||||
s string
|
||||
}
|
||||
|
||||
// ans 是答案
|
||||
// one 代表第一个答案
|
||||
type ans394 struct {
|
||||
one string
|
||||
}
|
||||
|
||||
func Test_Problem394(t *testing.T) {
|
||||
|
||||
qs := []question394{
|
||||
|
||||
question394{
|
||||
para394{"10[a]"},
|
||||
ans394{"aaaaaaaaaa"},
|
||||
},
|
||||
|
||||
question394{
|
||||
para394{"3[a]2[bc]"},
|
||||
ans394{"aaabcbc"},
|
||||
},
|
||||
|
||||
question394{
|
||||
para394{"3[a2[c]]"},
|
||||
ans394{"accaccacc"},
|
||||
},
|
||||
|
||||
question394{
|
||||
para394{"2[abc]3[cd]ef"},
|
||||
ans394{"abcabccdcdcdef"},
|
||||
},
|
||||
}
|
||||
|
||||
fmt.Printf("------------------------Leetcode Problem 394------------------------\n")
|
||||
|
||||
for _, q := range qs {
|
||||
_, p := q.ans394, q.para394
|
||||
fmt.Printf("【input】:%v 【output】:%v\n", p, decodeString(p.s))
|
||||
}
|
||||
fmt.Printf("\n\n\n")
|
||||
}
|
Reference in New Issue
Block a user