MAXDIFF Solution

Problem :- https://www.codechef.com/problems/MAXDIFF

Solution :- https://www.codechef.com/viewsolution/28602892
What is the error in my solution…??

you should add 1 more condition that if (k>n-k) than k=n-k.
Than your code will work fine.

Thanks, Mate.