Hi all, I am trying to solve this question,I got some logic and implemented it but getting WA on test case 11. Here is my code.
Don't know whats wrong with my logic or code as I have tried many cases by myself, for all of them I got the correct output.
Also please help me in understanding this submission for the same why he used prefix sum and how it is different from my logic. Please help me. Thanks.