What is wrong in my approach?

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

For The problem https://www.codechef.com/problems/RECCKT/.

Corrected My Approach At Last. Elements Only Greater Than index i are to be searched to get maximum fluctuation.
https://www.codechef.com/viewsolution/8797251

//