Update 2023/Day2/part2.js

This commit is contained in:
x0x7 2024-11-30 00:07:17 -05:00
parent f8b43904f3
commit 7c0f5d9652
1 changed files with 0 additions and 7 deletions

View File

@ -9,13 +9,6 @@ var maxes = {
blue:14
};
//var sum=0;
//for(var gameid=1;gameid<=games.length;++gameid) {
// var game = games[gameid-1];
// var bad = game.some(sample=>sample.some(([count,color])=>count>maxes[color]));
// if(!bad) sum+=gameid;
//}
var allpower = games.reduce((acc,game)=>{
var base={red:0,blue:0,green:0};
game.forEach(sample=>sample.forEach(([count,color])=>base[color]=Math.max(base[color],count)));