This commit is contained in:
VicRen
2020-11-14 09:41:36 +08:00
parent 7e8be82829
commit 20b5ac7848
4 changed files with 62 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ func main() {
fmt.Println(isCompliance([]int{2, 3, 3, 2, 4}))
fmt.Println(isCompliance([]int{3, 3, 2, 4}))
fmt.Println(isCompliance([]int{4, 5, 1, 2}))
fmt.Println(isCompliance([]int{5, 1, 2, 3}))
}
func isCompliance(nums []int) bool {

View File

@@ -21,6 +21,11 @@ func Test_isCompliance(t *testing.T) {
args{[]int{4, 2, 1}},
false,
},
{
"example_3",
args{[]int{5, 1, 2, 3}},
true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {