Why not accepting 3rd test case?
chaeck for this test case
10 3
2 1
3 1
4 3
5 4
6 5
7 1
8 6
9 2
10 6
correct ans is 8 but ur code gives 6.
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.