Please tell me where i am wrong.My solution
try deleting all elements that comes after 0 in each iteration.
so,the array would be like:
2 2 3 1 4
1 1 2 //applied - min_element and deleted element after zero
please tell me how answer is 11.Thanks for replying:grinning:
I was using int for ans but it was exceeding the range of int that’s i was getting WA.My bad
exteremly sorry your code was correct for my test case.
Its ok bro.
100 100 100
answer should be 300 i think