剑指offer-栈的压入、弹出序列
2017-11-27 21:00
316 查看
class Solution: def IsPopOrder(self, pushV, popV): # write code here l,j=[],0 if not pushV or not popV: return False for i in range(len(pushV)): l.append(pushV[i]) while j<len(popV) and popV[j]==l[-1]: l.pop() j+=1 return not l
参考https://www.nowcoder.com/questionTerminal/d77d11405cc7470d82554cb392585106的思路来写的。
相关文章推荐
- [剑指offer]面试题22:栈的压入、弹出序列
- 剑指 offer set 10 栈的压入、弹出序列
- 栈的压入、弹出序列 (剑指Offer 第 20 题)
- [剑指offer]栈的压入、弹出序列
- 剑指offer 22. 栈的压入、弹出序列
- 剑指offer之十六---栈的压入、弹出序列
- 【剑指offer】面试题22:栈的压入、弹出序列
- 剑指offer 二叉树的深度 顺时针打印矩阵 包含min函数的栈 栈的压入、弹出序列
- 剑指offer--面试题22:栈的压入、弹出序列--Java实现
- 【剑指offer 面试题22】栈的压入、弹出序列
- 【剑指offer】栈的压入弹出序列
- (5)剑指Offer之栈变队列和栈的压入、弹出序列
- 剑指offer之面试题22:栈的压入、弹出序列
- 【剑指offer-Java版】22栈的压入弹出序列
- 剑指Offer面试题:20.栈的压入、弹出序列
- 剑指 offer:栈的压入、弹出序列
- 剑指Offer - 九度1366 - 栈的压入、弹出序列
- 剑指offer之面试题22:栈的压入、弹出序列
- 【剑指offer】4.3举例让抽象问题具体化——面试题22:栈的压入、弹出序列
- 剑指Offer----栈的压入、弹出序列