This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`...001011000100 | |
111001010010`.split('\n').map(x => parseInt(x, 2)); | |
var o2 = input; | |
for (var i = 11; i >= 0; i--) { | |
var count = 0; | |
for (var num of o2) { | |
if (num >> i & 1 != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var map = {}; | |
var o = 0; | |
`<input>`.split('\n').map(function(r) { | |
var c = r.split(' '); | |
var p = c[2].split(',').map(x => parseInt(x)); | |
var s = c[3].split('x').map(x => parseInt(x)); | |
for (var y = p[1]; y < p[1] + s[1]; y++) { | |
for (var x = p[0]; x < p[0] + s[0]; x++) { | |
if (map[y + '_' + x] == undefined) { | |
map[y + '_' + x] = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = `<input>`.split('\n'); | |
var two = 0; | |
var three = 0; | |
for (var id of input) { | |
var seen = {}; | |
for (var l of id) { | |
seen[l] = (seen[l] || 0) + 1; | |
} | |
var twos = false; | |
var threes = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nums = `<input>`.split('\n'); | |
var total = 0; | |
for (var num of nums) { | |
total += parseInt(num); | |
} | |
console.log(total); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am iopred on github. | |
* I am iopred (https://keybase.io/iopred) on keybase. | |
* I have a public key whose fingerprint is 2448 A4B2 49DB BE7E 4F14 5E90 D975 98FD 33F7 35F2 | |
To claim this, I am signing this object: |