https://www.codechef.com/viewsolution/66982493
Problem Code:BTAR
Contest Code:COOK89
Hey,
Thank you for replying. I read the editorial which has the same approach as yours, I was trying to solve this using maps… could you tell me which test case my code fails?
Check the output of the following test.
1
9
1 1 1 1 1 1 1 2 3
Your code answer is 7, while the expected answer is 6.
Thanks a lot, I just realised that I didn’t handle the cases with 1’s and 2’s remaining.