Talk is cheap.
func isPopOrder(pushV []int , popV []int) bool{
if len(pushV) != len(popV) {
return false
}
stack, i := []int{}, 0
for _, v := range pushV {
stack = append(stack, v)
for len(stack) != 0 && stack[len(stack)-1] == popV[i] {
stack = stack[:len(stack)-1]
i += 1
}
}
return len(stack) == 0
}