day 1 complete

This commit is contained in:
Tanishq Dubey 2022-12-03 00:17:28 -05:00
parent e07ae80bf5
commit 4ec3d4daaa

View File

@ -14,4 +14,7 @@ for (const calorieData of rawCalories) {
parsedCalories.push(total);
}
console.log(Math.max(...parsedCalories));
parsedCalories = parsedCalories.sort((n1, n2) => n1 - n2);
console.log(parsedCalories[parsedCalories.length - 1]);
console.log(parsedCalories[parsedCalories.length - 1] + parsedCalories[parsedCalories.length - 2] + parsedCalories[parsedCalories.length - 3]);