Very similar as "Implement Stack using Queues". classQueue { stack<int>_s0; stack<int>_s1;int_front;public://Push element x to the back of queue.voidpush(intx) {if(_s0.empty()) _front =x; _s0.push(x); }//Removes the element from in front of queue.voidpop(void) {while(!
Create a HackerRank account Be part of a 26 million-strong community of developers Please signup or login in order to view this challenge I agree to HackerRank'sTerms of ServiceandPrivacy Policy. Sign up or Already have an account?Log in...