标签:判断 solution 假设 pen else append tac describe col
class Solution: def IsPopOrder(self, pushV, popV): # write code here lenpushV=len(pushV) lenpopV=len(popV) i=0 j=0 stack=[] while i<lenpushV: stack.append(pushV[i]) while len(stack) is not 0 and stack[-1]==popV[j]: stack.pop(-1) j+=1 i+=1 if len(stack)==0: return True else: return False
思路:模拟这个过程
标签:判断 solution 假设 pen else append tac describe col
原文地址:https://www.cnblogs.com/zhaiyansheng/p/10415292.html