OSTTRA interview question

max sum in a contiguous subarry, given an input string find if it is present in a sorted array.