ignore last empty line, a bit stupid to include in each assignment

This commit is contained in:
Wouter Groeneveld 2023-12-03 13:23:13 +01:00
parent 4f8b77beb7
commit a66110f9b9
6 changed files with 12 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.bin
*.sublime-workspace

View File

@ -2,7 +2,6 @@
module.exports.solve = function(input) {
return input.split('\n')
.filter(line => line.length > 1)
.map(line => {
const nrs = line.replace(/[^0-9.]/g, '')
return parseInt(nrs[0] + nrs[nrs.length - 1])

View File

@ -29,7 +29,6 @@ module.exports.solve = function(input, bagConfig) {
}
return input.split('\n')
.filter(line => line.length > 1)
.map(parseGame)
.filter(isGamePossible)
.map(game => game.id)

View File

@ -0,0 +1,8 @@
{
"folders":
[
{
"path": "."
}
]
}