https://ideone.com/e.js/ApxIq8
Someone help me with this problem. My idea is to push the numbers into another stack until one comes. And the later check in the other stack if the upper elements are smaller than the below elements. https://ideone.com/e.js/ApxIq8
Check the input format - there’s no number of test cases.
The input format i used was the one which was told by some other users in the discussion on some other thread… and it seems that it worked for them.I guess there is some flaw in my logic.
No, it can’t have worked for them because there is no number of test cases. Are you sure they were referring to STPAR?
When you test your program with the sample test case, does it give the expected answer?
Here is the link where the format of input is displayed.
Exactly! There’s no number of test cases.
The first 2 means there are two love mobiles, the the next line gives their order.
The lone 3 means there are three love mobiles, and the next line gives their order.
What does the final 0 mean?