0
/ 10
Write the method int addBeforeNegative(int[] nums) in Java that returns the sum of the elements in the array nums up till the first...
Write the method int addBeforeNegative(int[] nums)
in Java that returns the sum of the elements in the array nums
up till the first negative number.
Examples:
addBeforeNegative({51,9,10}) -> 70
addBeforeNegative({51,9,-10}) -> 60
addBeforeNegative({-51,-9,-10}) -> 0
Your feedback will appear here when you check your answer.