function sumsInArray(arr){
const newArr = [];
for (let i = 0; i < arr.length; i++){
let sum = 0;
if (arr[i].length === 0) newArr.push(sum);
for (let j = 0; j < arr[i].length; j++){
sum += arr[i][j];
if (j === arr[i].length - 1) {
newArr.push(sum);
sum = 0;
}
}
}
return newArr;
}