athenahealth interview question

Maximum given sum from array