Fynd interview question

sub array finding sum in java