3 ms·
quick, person who doesn't read articles at all where it states that amount a few times: 66,795
by jasonlbaptiste 18y ago
quick, person who doesn't read articles at all where it states that amount a few times: 66,795
- snprbob86 18y agoHe was asking for the _algorithm_ not the solution. The constant time approximation is (count^2) / 2 365 * 365 / 2 = 66,612.5 I'm sure there is a constant time exact solution as well :-)
- jd 18y agox = 365; ((x + 1) * x) / 2 # 66795 For x > 2 and odd.
- eru 18y agoIn this case the solution is also the algorithm in a technical sense, because algorithms solve classes of problems and we can just define the class to consinst of this sole instance. Then 66795 is the algorithm that works for the whole (singleton) class of instances.