Hacker News new | past | comments | ask | show | jobs | submit login

Maybe they want the median age in number of days?



Assuming Methuselah doesn't work for you, you can still do that in about 200k of memory.


Only at the cost of poor cache locality. :)


Shouldn't it fit completely in L1 (or at worst, L2)? You need roughly 146,100 bytes: 120 years * 365.25 days/year * 4 bytes/day (uint32 as an accumulator) = 175,320 kb.

MacBooks have something like 192 kb shared + 128 kb/core, so that should be okay if not much else is going on....




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: