You are viewing a single comment's thread. Return to all comments →
Can be done using Stack
stack<int>s; for(auto x : a){ if(!s.empty() && s.top() > x ) continue; s.push(x); } if(s.size()%2 == 0) return "ANDY"; else return "BOB";
Seems like cookies are disabled on this browser, please enable them to open this website
Gaming Array
You are viewing a single comment's thread. Return to all comments →
Can be done using Stack