CLETAB - Editorial

Could someone help identifying a test case causing WA. I have tried all the test cases posted here and it seems to pass all of them. My solution

I am not able to understand , why you not use sorting . like take a test case,

3 5
1 2 1 3 4

my approach - 1 1 2 3 4.
now repetitive number should consider as 1 and we should move.

this is my solution - CodeChef: Practical coding for everyone

Can 7 appear without prior presence of 1,2,3,4,5,6 ?.Is this test case valid?

this editorial is not clear. It does not tells clearly about the farthest customer(like which farthest).
everybody is facing the same problem .
I waste 2 hours on this …
.

the output is 9 cause we take the output as the no. of times any number is replaced by another(here number is the customer)
7 6 1 - 3
2 6 1 - 4
2 6 3 - 5
2 6 4 - 6
2 6 3 - 7
2 6 1 - 8
7 6 1 - 9
so total of 9 times any number is replaced by other

Can some one explain me the problem statement?. I just can’t understand.

one more edge test case which my code is failing
1
2 7
1 2 3 2 3 1 1

my answer is right for this one also but still when I submit it is giving WA
the answer is :- CodeChef: Practical coding for everyone

what should be the answer I got 4.

dude can you review my solution ??
solution :- CodeChef: Practical coding for everyone

asking you because you are the only one with a java solution.

I think my solution is having the Optimal Approach but still it’s giving me a WA can anyone please review this one ??
https://www.codechef.com/viewsolution/38135449

https://www.codechef.com/viewsolution/38925368

tried all the testcases mentioned here but still wa :face_with_head_bandage:
anybody up to help
thanks.

Got AC in first go!!!