From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Advent of Code Day 8 Date: Thu, 10 Dec 2020 11:24:09 -0800 Organization: Aioe.org NNTP Server Message-ID: <86h7otcvmu.fsf@stephe-leake.org> References: <86lfe6d9ui.fsf@stephe-leake.org> <254cb409-5afc-4d3c-bd87-6062450d2a85n@googlegroups.com> <9f68c8b6-0018-4722-9572-ea6041fb2bccn@googlegroups.com> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cancel-Lock: sha1:KV3iEz1ajUI9jKCdPMiqQ1pje8g= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:60794 List-Id: John Perry writes: > On Thursday, December 10, 2020 at 3:07:22 AM UTC-6, Maxim Reznik wrote: >> Do you consider my solution for Day 9 as brute force one? ;) >> >> https://github.com/reznikmm/ada-howto/blob/advent-2020/md/09/09.md > > I really like this approach, but it seems equivalent. + 1. You process each number in the input file only once, which is very nice. It avoids keeping all the numbers in memory at once, so could work for _very_ large files (although then you'd need integers much larger than 64 bits as well). -- -- Stephe