tried all the cases i can think of and still shown WA upon submission. what’s wrong in my code? question: https://www.spoj.com/problems/ACPC11B/
my solution:https://ideone.com/e.js/a3N8OL
Try this
2 8 2 3 5 10 9 3 2 1 7 1 2 6 12 13 3 2 8 1 3 5 7 9 7 3 1 8 2 4 6 8 10 8 6 2
It’s the same two test cases given in the problem, but in reverse order, so expected answers are
0 1
Thank you for the insight. I did catch my mistake.