how to take input from user in stack<pair<int, int> > s;
How to take input from user in stack<pair<int, int> > s;
hi @utkarsh.gupta0311 where do u need this stack of pairs this question doesnt need that, use simple stack
as in the question input is like
2 73
2 43
thats why i took a stack of pairs
i thought if s.top().first is 1 i pop and print
if its 2 i push s.top().second
ohhkk i understood the mistake … but is it possible to take input from user in a stack of pair???
how can u share some blog to learn
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.