We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee35c0 commit d11b390Copy full SHA for d11b390
2020/14/index.js
@@ -31,10 +31,7 @@ function version2(program) {
31
let [,i,v] = line.match(/mem\[([\d]*)\] = ([\d]*)/)
32
bin = Number(i).toString(2).padStart(36, '0')
33
const addressBin = mask.split('').map((m, b) => m === '0' ? bin[b] : m === '1' ? 1 : 'X').join('')
34
- floatingValues(addressBin).forEach(value => {
35
- mem[value] = Number(v)
36
- })
37
-
+ floatingValues(addressBin).forEach(value => mem[value] = Number(v))
38
}
39
})
40
return Object.keys(mem).map(m => mem[m]).reduce((a, b) => a + b, 0)
0 commit comments