Need help with PAPARAZI from March long challenge

Problem: PAPARAZI Problem - CodeChef
My solution: CodeChef: Practical coding for everyone

I’m only getting AC in two test cases overall. I’d appreciate if anyone can help with this exact approach or help me with the edge cases.

I’ve added comments to the code so that you can understand what I’m trying to do.

Try this test case
1
8
5 4 1 1 1 1 1 1
Your output - 6
Correct output - 7

1 Like

1
9
1 2 4 8 10 15 20 22 3
your output: 3
correct output: 6

you are not comparing the previous value in “arr” just last value
may be there will be a previous value that can be visible from current point

1 Like