InterviewBit Problems   Maximum Sum Triplet : Solved

About the Maximum Sum Triplet : Solved category (1)
Can anyone please check and let me know why this code is giving wrong answer? (1)
Most Efficient Solution explained in detail (1)
Can anyone suggest a way to descrease the time complexity - getting TLE (1)
What is the wrong in this answer (3)
Nice solution (both O(nlogn) and O(n^2)) to this interesting question (1)