Do the suffix first, then do the prefix. If sum of odd and even number amount of pref and suff are same and sum of pref + suff <= k, compare the answer.
While doing the prefix erase the suffix that index is smaller then current pointer or sum of pref and suff > k. O(N)
Or you can do then binary search to find the largest legal suffix. (O(NlogN))