hi @vaporeon_ wanna see Advent of Clod code so golfed that its not even a spoiler?
@wallhackio @vaporeon_ well i sure do
advent of clod "spoiler" Show more
@aescling @vaporeon_
console.log( "solution:", Deno.readTextFileSync("day-03-q1-input.txt").split("\r\n").reduce((a, s) => { for (var d = new Array(12).fill(-1), m = { "-1": -1 }, i = 0; i < 12; ++i) for (let j = m[i - 1] + 1; j < s.length - 11 + i; ++j) if (+s[j] > d[i]) d[i] = +s[m[i] = j]; return a + d.reduce((sum, n, i, a) => sum + 10 ** (a.length - 1 - i) * n, 0); }, 0));
despite what you may suspect from the double for loop, this runs in O(n) time
A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.
advent of clod "spoiler"
@aescling @vaporeon_
despite what you may suspect from the double for loop, this runs in O(n) time