标签:bool code 整数 dex i++ false || div null
1 import java.util.ArrayList; 2 3 import java.util.Stack; 4 5 public class Solution { 6 public boolean IsPopOrder(int [] pushA,int [] popA) { 7 if(pushA==null||popA==null) 8 return false; 9 Stack<Integer> stack=new Stack<>(); 10 int index=0; 11 for(int i=0;i<pushA.length;i++) { 12 stack.push(pushA[i]); 13 while(!stack.isEmpty()&&stack.peek()==popA[index]) { 14 stack.pop(); 15 index++; 16 } 17 } 18 return stack.isEmpty(); 19 } 20 }
标签:bool code 整数 dex i++ false || div null
原文地址:https://www.cnblogs.com/jacob-wuhan/p/12979778.html