I was attempting this question. Kefa and Park but I am getting WA in test case 10. Can anyone please help. Link: http://codeforces.me/contest/580/submission/18113202 Thanks
I was attempting this question. Kefa and Park but I am getting WA in test case 10. Can anyone please help. Link: http://codeforces.me/contest/580/submission/18113202 Thanks
Here is small test that fails your program:
3 3
1 1 1
2 3
1 2
Your code outputs 2, while answer is 1.