BUYOGO interview question

Find the sum of sub array.