there's a special pattern here
for i<j suppose for i=1 we traverse j from 1 to n
and we find the max sssum at j=3
then fro all i from 1 to n max sssum will be at j=3 but there's a catch here i could be bigger than 3.
similar patter is also there for i>j.
Think from brute force solution and build up.
Time Complexity O(n)