标签:break public return style continue turn == ice office
1 class Solution { 2 public: 3 bool IsPopOrder(vector<int> pushV,vector<int> popV) { 4 int len=pushV.size(),pos=0,r=0,i=0; 5 int q[len+10]; 6 while (pos<len){ 7 if (r==0){ 8 q[r++]=pushV[i++]; 9 continue; 10 } 11 if (q[r-1]!=popV[pos]){ 12 if (i<len) 13 q[r++]=pushV[i++]; 14 else 15 break; 16 } 17 else{ 18 pos++; 19 r--; 20 } 21 } 22 if (pos==len) return true; 23 else return false; 24 } 25 };
标签:break public return style continue turn == ice office
原文地址:https://www.cnblogs.com/q1204675546/p/13362563.html