http://www.nxcoding.com/archives/leetcode-daily-2874-maximum-triplet-value-prefix-suffix-greedy