办法一:一一元素进行比拟
func equal(s1 []int , s2 []int) bool {if len(s1) != len(s2) {return false}
for i := 0; i < len(s1); i++ {if s1[i] != s2[i] {return false}
}
return true
}
办法二:应用 reflect.DeepEqual 函数
func equal(s1 []int , s2 []int) bool {return reflect.DeepEqual(s1, s2)
}