aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-02 16:59:12 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-03 15:50:58 +0200
commita9cfe1ddecbb711cd5b3bc9d544e77197869dcd9 (patch)
tree130c8d58923288f29766474140028a44fb1cb8a7
Solve day01
-rw-r--r--.gitignore17
-rw-r--r--CHANGELOG.md24
-rw-r--r--LICENSE280
-rw-r--r--README.md22
-rw-r--r--doc/intro.md3
-rw-r--r--project.clj7
-rw-r--r--resources/day01_actual.txt2250
-rw-r--r--resources/day01_sample.txt14
-rw-r--r--src/aoc_2022/day01.clj34
9 files changed, 2651 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5876fe0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,17 @@
+/target
+/classes
+/checkouts
+profiles.clj
+pom.xml
+pom.xml.asc
+*.jar
+*.class
+/.lein-*
+/.nrepl-port
+/.prepl-port
+.hgignore
+.hg/
+
+.calva/
+.clj-kondo/
+.lsp/
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..fde3818
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,24 @@
+# Change Log
+All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
+
+## [Unreleased]
+### Changed
+- Add a new arity to `make-widget-async` to provide a different widget shape.
+
+## [0.1.1] - 2022-12-02
+### Changed
+- Documentation on how to make the widgets.
+
+### Removed
+- `make-widget-sync` - we're all async, all the time.
+
+### Fixed
+- Fixed widget maker to keep working when daylight savings switches over.
+
+## 0.1.0 - 2022-12-02
+### Added
+- Files from the new template.
+- Widget maker public API - `make-widget-sync`.
+
+[Unreleased]: https://sourcehost.site/your-name/aoc-2022/compare/0.1.1...HEAD
+[0.1.1]: https://sourcehost.site/your-name/aoc-2022/compare/0.1.0...0.1.1
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..2315126
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,280 @@
+Eclipse Public License - v 2.0
+
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+ i) changes to the Program, and
+ ii) additions to the Program;
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ "originates" from a Contributor if it was added to the Program by
+ such Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+
+"Contributor" means any person or entity that Distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which
+are necessarily infringed by the use or sale of its Contribution alone
+or when combined with the Program.
+
+"Program" means the Contributions Distributed in accordance with this
+Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement
+or any Secondary License (as applicable), including Contributors.
+
+"Derivative Works" shall mean any work, whether in Source Code or other
+form, that is based on (or derived from) the Program and for which the
+editorial revisions, annotations, elaborations, or other modifications
+represent, as a whole, an original work of authorship.
+
+"Modified Works" shall mean any work in Source Code or other form that
+results from an addition to, deletion from, or modification of the
+contents of the Program, including, for purposes of clarity any new file
+in Source Code form that contains any contents of the Program. Modified
+Works shall not include works that contain only declarations,
+interfaces, types, classes, structures, or files of the Program solely
+in each case in order to link to, bind by name, or subclass the Program
+or Modified Works thereof.
+
+"Distribute" means the acts of a) distributing or b) making available
+in any manner that enables the transfer of a copy.
+
+"Source Code" means the form of a Program preferred for making
+modifications, including but not limited to software source code,
+documentation source, and configuration files.
+
+"Secondary License" means either the GNU General Public License,
+Version 2.0, or any later versions of that license, including any
+exceptions or additional permissions as identified by the initial
+Contributor.
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if, at
+ the time the Contribution is added by the Contributor, such addition
+ of the Contribution causes such combination to be covered by the
+ Licensed Patents. The patent license shall not apply to any other
+ combinations which include the Contribution. No hardware per se is
+ licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the
+ rights and licenses granted hereunder, each Recipient hereby
+ assumes sole responsibility to secure any other intellectual
+ property rights needed, if any. For example, if a third party
+ patent license is required to allow Recipient to Distribute the
+ Program, it is Recipient's responsibility to acquire that license
+ before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has
+ sufficient copyright rights in its Contribution, if any, to grant
+ the copyright license set forth in this Agreement.
+
+ e) Notwithstanding the terms of any Secondary License, no
+ Contributor makes additional grants to any Recipient (other than
+ those set forth in this Agreement) as a result of such Recipient's
+ receipt of the Program under the terms of a Secondary License
+ (if permitted under the terms of Section 3).
+
+3. REQUIREMENTS
+
+3.1 If a Contributor Distributes the Program in any form, then:
+
+ a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including
+ warranties or conditions of title and non-infringement, and
+ implied warranties or conditions of merchantability and fitness
+ for a particular purpose;
+
+ ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special,
+ incidental and consequential damages, such as lost profits;
+
+ iii) does not attempt to limit or alter the recipients' rights
+ in the Source Code under section 3.2; and
+
+ iv) requires any subsequent distribution of the Program by any
+ party to be under a license that satisfies the requirements
+ of this section 3.
+
+3.2 When the Program is Distributed as Source Code:
+
+ a) it must be made available under this Agreement, or if the
+ Program (i) is combined with other material in a separate file or
+ files made available under a Secondary License, and (ii) the initial
+ Contributor attached to the Source Code the notice described in
+ Exhibit A of this Agreement, then the Program may be made available
+ under the terms of such Secondary Licenses, and
+
+ b) a copy of this Agreement must be included with each copy of
+ the Program.
+
+3.3 Contributors may not remove or alter any copyright, patent,
+trademark, attribution notices, disclaimers of warranty, or limitations
+of liability ("notices") contained within the Program from any copy of
+the Program which they Distribute, provided that Contributors may add
+their own appropriate notices.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities
+with respect to end users, business partners and the like. While this
+license is intended to facilitate the commercial use of the Program,
+the Contributor who includes the Program in a commercial product
+offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes
+the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and indemnify every
+other Contributor ("Indemnified Contributor") against any losses,
+damages and costs (collectively "Losses") arising from claims, lawsuits
+and other legal actions brought by a third party against the Indemnified
+Contributor to the extent caused by the acts or omissions of such
+Commercial Contributor in connection with its distribution of the Program
+in a commercial product offering. The obligations in this section do not
+apply to any claims or Losses relating to any actual or alleged
+intellectual property infringement. In order to qualify, an Indemnified
+Contributor must: a) promptly notify the Commercial Contributor in
+writing of such claim, and b) allow the Commercial Contributor to control,
+and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may
+participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those performance
+claims and warranties, and if a court requires any other Contributor to
+pay any damages as a result, the Commercial Contributor must pay
+those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
+PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
+BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
+TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
+PURPOSE. Each Recipient is solely responsible for determining the
+appropriateness of using and distributing the Program and assumes all
+risks associated with its exercise of rights under this Agreement,
+including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs
+or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
+PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
+SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
+EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other software
+or hardware) infringes such Recipient's patent(s), then such Recipient's
+rights granted under Section 2(b) shall terminate as of the date such
+litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient's obligations under this Agreement and any licenses
+granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and
+may only be modified in the following manner. The Agreement Steward
+reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement
+Steward has the right to modify this Agreement. The Eclipse Foundation
+is the initial Agreement Steward. The Eclipse Foundation may assign the
+responsibility to serve as the Agreement Steward to a suitable separate
+entity. Each new version of the Agreement will be given a distinguishing
+version number. The Program (including Contributions) may always be
+Distributed subject to the version of the Agreement under which it was
+received. In addition, after a new version of the Agreement is published,
+Contributor may elect to Distribute the Program (including its
+Contributions) under the new version.
+
+Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+receives no rights or licenses to the intellectual property of any
+Contributor under this Agreement, whether expressly, by implication,
+estoppel or otherwise. All rights in the Program not expressly granted
+under this Agreement are reserved. Nothing in this Agreement is intended
+to be enforceable by any entity that is not a Contributor or Recipient.
+No third-party beneficiary rights are created under this Agreement.
+
+Exhibit A - Form of Secondary Licenses Notice
+
+"This Source Code may also be made available under the following
+Secondary Licenses when the conditions for such availability set forth
+in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public
+License as published by the Free Software Foundation, either version 2
+of the License, or (at your option) any later version, with the GNU
+Classpath Exception which is available at
+https://www.gnu.org/software/classpath/license.html."
+
+ Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+
+ If it is not possible or desirable to put the notice in a particular
+ file, then You may include the notice in a location (such as a LICENSE
+ file in a relevant directory) where a recipient would be likely to
+ look for such a notice.
+
+ You may add additional accurate notices of copyright ownership.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c2cdbd7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,22 @@
+# aoc-2022
+
+A Clojure library designed to ... well, that part is up to you.
+
+## Usage
+
+FIXME
+
+## License
+
+Copyright © 2022 FIXME
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License 2.0 which is available at
+http://www.eclipse.org/legal/epl-2.0.
+
+This Source Code may also be made available under the following Secondary
+Licenses when the conditions for such availability set forth in the Eclipse
+Public License, v. 2.0 are satisfied: GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or (at your
+option) any later version, with the GNU Classpath Exception which is available
+at https://www.gnu.org/software/classpath/license.html.
diff --git a/doc/intro.md b/doc/intro.md
new file mode 100644
index 0000000..40919eb
--- /dev/null
+++ b/doc/intro.md
@@ -0,0 +1,3 @@
+# Introduction to aoc-2022
+
+TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)
diff --git a/project.clj b/project.clj
new file mode 100644
index 0000000..85ebc21
--- /dev/null
+++ b/project.clj
@@ -0,0 +1,7 @@
+(defproject aoc-2022 "0.1.0-SNAPSHOT"
+ :description "FIXME: write description"
+ :url "http://example.com/FIXME"
+ :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
+ :url "https://www.eclipse.org/legal/epl-2.0/"}
+ :dependencies [[org.clojure/clojure "1.11.1"]]
+ :repl-options {:init-ns aoc-2022.core})
diff --git a/resources/day01_actual.txt b/resources/day01_actual.txt
new file mode 100644
index 0000000..da4f98e
--- /dev/null
+++ b/resources/day01_actual.txt
@@ -0,0 +1,2250 @@
+9609
+7601
+7142
+5278
+9374
+6815
+1050
+6329
+8016
+
+12477
+28601
+
+1056
+5037
+1660
+3786
+2611
+6689
+3159
+2973
+5286
+2401
+6231
+7460
+
+3689
+3909
+9254
+5704
+10307
+10173
+9336
+4586
+
+5476
+16022
+9109
+11504
+6746
+
+1006
+1685
+2688
+4776
+6234
+5807
+4943
+4944
+4982
+1731
+3196
+5573
+5269
+1266
+
+12097
+15573
+1113
+8920
+14145
+
+4723
+2428
+3864
+4657
+5046
+5135
+5104
+1867
+5130
+1751
+6029
+4551
+1924
+4998
+4255
+
+2706
+5595
+10508
+3676
+11580
+6061
+7902
+
+2523
+11236
+1915
+15774
+7639
+
+2996
+3656
+4491
+4493
+6136
+3112
+7342
+3600
+6111
+4229
+7548
+
+4200
+8635
+1003
+1223
+3096
+10734
+8319
+3772
+
+7063
+3538
+4856
+1250
+1917
+4852
+4792
+7407
+3413
+7326
+7378
+1778
+
+1659
+3390
+2802
+3226
+3993
+9583
+6504
+3296
+5998
+
+1800
+1144
+2569
+4426
+5871
+4988
+1309
+2330
+3236
+3217
+3778
+2636
+3116
+2300
+1428
+
+69249
+
+6905
+2506
+2429
+3904
+2960
+1420
+2687
+7150
+1368
+4253
+3584
+1302
+
+9585
+34214
+
+5442
+8217
+2320
+6864
+1354
+5791
+5492
+4979
+1760
+7753
+
+18036
+11876
+1936
+4605
+
+10819
+13733
+13726
+10233
+
+5450
+4315
+3008
+3419
+5434
+1601
+6834
+2144
+3943
+3573
+6366
+6680
+1197
+
+3681
+4233
+3461
+1646
+5161
+3542
+5489
+4635
+1776
+4811
+3026
+4858
+4207
+5716
+4751
+
+3271
+5205
+7916
+7618
+8354
+4445
+4604
+
+2489
+7439
+6911
+5378
+7363
+2207
+7303
+4757
+5989
+4902
+6889
+5074
+
+4451
+34499
+
+6519
+7439
+2225
+1237
+2167
+2041
+3403
+8289
+3545
+2936
+
+25613
+23988
+15999
+
+10278
+9240
+8736
+10445
+5005
+9339
+9059
+9198
+
+14821
+8000
+15113
+10430
+11981
+
+2745
+6427
+3564
+3822
+1674
+6615
+4817
+5026
+6243
+5295
+4027
+4861
+6554
+
+24901
+7628
+
+10299
+8153
+3359
+5982
+5207
+4491
+5267
+5364
+
+7962
+12190
+1998
+10722
+2890
+
+27425
+19199
+
+5347
+3738
+2833
+12747
+6505
+3476
+
+2360
+6688
+11640
+13899
+
+5152
+4272
+7284
+3491
+4225
+3271
+7751
+6376
+2695
+
+8227
+7171
+3366
+1663
+4466
+2444
+7239
+3673
+5321
+6363
+
+6362
+4237
+7358
+1723
+7514
+5741
+2621
+4413
+5502
+5875
+
+13451
+12610
+8672
+2841
+
+1956
+3310
+3011
+2938
+5046
+4571
+3326
+2013
+5980
+5145
+3226
+5073
+3676
+2763
+4542
+
+4200
+9203
+6238
+9501
+3972
+6776
+2730
+6126
+
+13151
+2622
+2592
+10013
+10227
+4677
+
+3151
+2107
+7564
+3219
+1353
+7924
+7287
+3273
+2117
+4211
+
+6914
+1354
+3517
+1835
+1694
+4044
+2569
+4755
+6720
+1104
+
+10704
+2576
+2773
+9002
+3321
+9443
+8346
+9054
+
+4584
+2075
+3303
+2156
+1250
+4717
+1391
+2977
+3845
+1433
+3112
+5675
+6058
+1451
+5500
+
+8712
+8235
+2732
+5337
+11076
+9434
+1593
+
+27831
+3385
+
+1497
+7378
+3442
+1957
+2620
+2208
+3808
+1793
+1306
+6721
+4098
+5050
+
+3197
+1377
+2289
+7534
+8484
+5831
+3671
+2524
+6756
+
+24827
+5119
+
+1701
+5156
+3625
+2469
+5728
+5698
+4538
+1505
+1475
+3934
+3758
+5405
+1549
+5019
+1433
+
+12606
+14593
+14761
+12375
+
+9284
+16208
+6022
+5550
+
+8956
+1473
+10077
+2220
+7314
+3561
+6013
+
+1064
+1538
+3292
+3854
+3882
+6008
+5364
+4326
+1958
+4712
+3389
+4496
+5501
+2181
+1666
+
+2424
+5342
+11963
+1108
+6698
+7440
+4334
+
+7167
+3677
+4923
+9204
+4469
+5934
+6071
+8355
+
+4457
+2779
+5014
+6156
+7431
+1879
+2349
+4038
+7353
+1453
+6980
+1890
+
+1348
+8892
+13667
+2877
+9049
+8967
+
+7904
+6871
+7301
+7952
+5953
+7562
+3289
+6654
+
+13903
+9705
+11858
+7619
+12963
+5629
+
+31307
+5533
+
+1431
+5521
+3430
+4972
+4077
+1771
+2134
+2614
+1464
+1882
+1471
+2024
+4789
+4419
+
+8927
+9768
+1070
+12640
+3597
+5034
+
+4369
+5821
+4181
+2802
+6503
+2530
+1530
+1047
+3537
+2732
+5169
+4156
+4348
+1831
+
+9491
+6837
+3855
+2320
+1689
+3393
+6974
+5192
+9255
+
+2791
+3416
+2183
+2919
+3732
+3010
+5213
+7927
+4855
+4468
+
+7089
+36535
+
+9669
+2139
+10069
+7918
+9942
+1446
+
+4381
+3053
+3216
+4395
+2710
+3329
+2837
+1395
+3310
+1598
+1620
+6310
+3405
+4005
+
+3639
+1485
+5221
+5767
+2415
+5401
+4011
+3377
+2977
+6529
+1921
+5012
+4426
+
+4202
+17425
+
+1350
+1077
+4747
+1735
+4362
+6110
+5006
+8519
+7785
+
+10393
+3532
+4113
+8856
+11626
+7552
+11220
+
+8925
+8081
+2340
+2296
+9558
+6452
+3604
+8601
+1958
+
+4519
+2675
+1343
+4853
+5372
+2362
+4274
+4636
+3144
+5231
+4867
+5533
+1505
+5978
+1649
+
+4955
+6133
+6469
+5120
+4257
+3936
+3661
+4995
+6040
+2616
+5863
+6886
+1653
+
+4106
+1467
+2641
+1772
+4588
+1750
+1333
+4312
+4852
+1508
+5620
+4535
+3888
+4007
+2194
+
+27508
+
+10203
+6474
+2054
+11285
+12800
+
+10249
+7004
+6396
+1990
+5883
+9275
+4687
+
+22359
+8260
+9536
+
+2657
+6895
+4538
+4635
+1259
+1819
+2679
+3703
+6127
+4197
+4009
+4652
+2708
+
+49278
+
+16243
+33427
+
+5219
+3052
+4510
+9946
+5429
+5163
+2653
+
+4676
+5247
+6267
+2648
+1257
+2335
+3737
+1443
+2726
+2361
+2134
+1952
+1021
+1753
+
+4671
+7281
+8217
+6170
+1182
+8778
+5289
+5035
+
+6067
+3461
+7448
+2117
+8702
+2849
+9659
+1410
+9402
+
+10607
+5652
+3127
+5594
+2423
+2591
+
+2138
+4007
+6383
+5597
+3074
+5811
+2178
+6220
+2212
+4271
+5410
+6677
+
+5313
+5507
+7753
+5492
+5041
+4967
+7644
+10538
+
+2062
+7568
+1439
+1621
+8216
+4952
+4358
+3391
+4776
+
+4015
+4854
+2935
+5177
+2131
+5192
+3300
+3337
+5223
+6469
+6101
+3917
+3492
+3986
+
+8942
+9447
+6152
+2764
+6196
+3116
+6478
+9334
+9346
+
+10560
+5894
+12105
+4239
+4573
+
+1752
+6751
+3684
+2236
+6195
+11108
+5450
+
+32451
+29152
+
+13915
+7001
+11778
+2626
+3026
+12725
+
+6410
+4265
+10923
+9587
+7411
+
+4943
+5272
+2453
+7324
+3815
+6049
+2936
+5905
+3187
+3675
+3860
+7143
+
+58413
+
+6544
+11733
+11746
+3288
+5411
+5555
+3796
+
+4852
+6567
+1494
+4644
+6183
+2444
+5145
+1015
+5088
+7905
+6491
+
+3550
+5679
+4312
+2128
+2262
+3597
+2249
+2472
+4758
+3927
+5369
+2278
+
+1399
+3791
+4817
+13948
+10037
+6154
+
+7877
+16900
+10571
+18965
+
+4836
+5457
+6380
+4241
+4969
+3635
+4160
+5451
+6164
+5334
+
+4961
+2514
+1620
+2494
+6373
+4040
+7544
+2595
+2330
+6927
+7906
+
+8023
+6672
+3565
+9038
+7154
+5236
+
+4297
+3122
+4779
+3937
+3165
+5012
+1298
+5405
+6175
+3862
+3469
+3533
+5411
+6349
+
+36291
+32851
+
+7992
+4095
+4841
+6728
+2275
+1549
+8143
+8494
+7144
+5800
+
+3064
+1314
+4224
+5969
+2913
+2622
+4833
+3113
+3663
+5351
+5102
+2930
+6048
+5658
+4773
+
+1771
+9851
+9844
+4001
+1343
+6124
+3826
+7647
+
+8488
+7700
+19028
+2822
+
+4541
+6311
+6499
+1043
+5888
+2631
+3824
+3137
+6957
+1372
+1755
+5852
+4944
+
+7010
+7705
+7380
+5693
+6466
+2388
+4584
+1309
+5295
+4232
+
+8997
+11222
+12715
+13341
+
+3389
+5375
+6730
+1723
+4179
+6599
+8482
+9599
+8903
+
+1774
+6964
+3739
+6345
+4881
+5381
+2415
+7900
+8778
+
+10638
+20181
+4651
+
+11271
+3243
+11634
+2919
+8121
+9706
+7354
+
+2675
+2809
+5554
+4439
+1626
+4173
+4273
+2551
+2302
+4167
+1929
+
+2641
+1264
+2074
+8265
+1089
+5010
+2591
+5610
+4610
+
+8082
+11994
+3820
+2770
+9252
+3948
+7731
+
+9429
+7117
+13052
+8925
+1844
+11783
+
+1288
+5874
+3708
+4770
+6241
+1823
+2081
+4040
+1675
+3309
+
+6185
+5449
+1262
+4549
+5293
+4790
+1854
+4853
+1727
+5514
+5256
+4148
+5514
+
+6609
+15270
+13973
+10316
+
+8083
+8381
+4788
+1606
+5118
+1520
+8152
+2433
+2999
+1784
+
+1178
+5284
+8781
+5156
+6160
+1957
+3163
+5129
+
+6123
+8854
+2776
+8899
+1728
+1459
+6248
+1676
+6804
+
+11240
+11672
+1993
+12007
+
+11441
+8463
+3348
+3292
+6021
+
+3765
+7412
+2551
+3571
+2806
+3018
+7255
+4727
+1812
+5666
+
+1111
+7513
+4547
+8423
+6838
+8520
+5818
+7891
+7659
+1029
+
+21630
+17117
+
+4790
+2925
+1959
+7089
+5283
+6020
+2522
+2052
+1519
+1591
+
+6012
+10136
+10443
+7841
+6019
+1279
+3540
+9068
+
+3937
+12491
+9763
+7498
+1701
+
+11876
+9043
+4713
+2987
+8774
+11370
+
+4885
+5614
+2665
+7454
+1350
+1832
+8687
+9477
+
+10654
+8624
+6594
+13129
+10246
+
+25357
+10959
+23864
+
+2554
+4768
+6464
+2757
+1927
+1861
+2175
+2322
+4198
+4037
+4752
+2082
+6003
+5328
+
+1820
+4090
+7653
+2160
+3455
+2144
+12128
+
+29265
+30377
+
+2359
+3949
+6123
+2235
+4210
+5808
+2377
+6678
+2039
+1324
+2104
+5407
+
+1955
+4478
+3696
+6486
+2206
+3083
+2843
+5454
+4294
+3972
+2556
+5795
+3319
+2315
+
+6188
+1383
+3880
+3153
+5842
+3400
+5504
+1353
+1257
+3639
+
+5550
+5255
+4095
+3951
+3104
+2344
+4580
+3980
+1482
+2521
+2764
+1607
+5699
+2350
+1175
+
+3326
+5681
+5905
+7268
+6083
+1407
+1434
+3186
+5744
+6268
+5533
+2245
+
+2994
+1141
+10449
+6013
+5210
+8014
+3136
+8434
+
+28983
+19936
+
+4560
+8754
+6220
+12071
+5989
+2858
+6333
+
+1928
+22562
+
+3804
+7720
+6499
+7651
+1860
+1193
+8243
+2693
+2515
+4517
+
+2762
+1303
+5390
+4371
+2424
+5039
+5875
+1354
+4039
+1883
+1398
+5544
+3698
+
+1312
+5037
+2534
+3404
+3494
+5859
+7520
+3173
+4187
+5593
+4094
+
+1938
+4558
+3961
+8752
+6733
+8402
+2351
+7059
+
+4650
+5453
+5251
+2503
+7601
+6322
+7193
+3568
+6734
+1254
+7263
+
+15442
+18712
+
+2671
+34633
+
+8092
+6200
+3593
+12427
+11897
+5342
+
+12145
+20778
+25515
+
+4318
+7326
+6324
+3726
+6176
+2530
+4017
+5504
+2930
+4978
+1941
+3893
+
+7431
+2579
+2463
+5818
+2616
+7477
+8840
+2943
+
+28974
+26077
+
+4317
+2950
+2298
+4360
+2323
+5028
+6040
+1223
+2836
+5338
+6002
+4551
+4505
+1046
+5007
+
+5979
+1142
+5901
+4646
+5486
+5184
+6255
+1473
+6420
+5358
+2502
+4997
+6331
+5529
+
+3641
+1705
+3924
+3952
+3856
+4687
+4962
+3754
+2049
+5361
+5286
+4157
+5753
+2937
+1996
+
+9825
+2077
+12304
+8296
+
+5576
+4979
+5746
+3423
+1339
+5466
+2956
+3201
+4612
+5538
+4957
+3095
+3211
+
+6162
+6797
+12282
+3848
+14760
+
+8520
+6433
+5529
+5617
+4572
+2395
+3228
+6012
+
+36432
+12115
+
+3396
+3826
+2514
+5297
+5768
+4673
+6134
+2153
+4533
+5530
+2289
+3910
+3429
+6315
+
+9288
+7564
+2801
+7672
+3580
+6425
+5047
+9141
+
+6455
+4624
+7937
+6151
+9671
+2857
+
+5789
+7291
+3051
+4587
+4527
+5970
+5863
+
+7496
+2170
+3522
+1108
+4284
+1214
+5981
+4240
+4880
+2816
+3638
+
+1458
+4890
+4046
+5337
+6192
+3705
+1362
+3330
+3593
+1036
+3842
+6485
+2170
+1176
+
+4669
+7457
+3290
+1471
+1471
+4983
+8120
+3964
+2012
+
+12196
+12907
+1360
+2359
+4034
+12061
+
+2023
+2376
+4602
+2529
+2091
+7266
+3696
+4104
+7007
+4183
+2551
+4913
+
+12264
+2297
+16633
+19219
+
+5963
+5584
+1534
+6499
+5988
+1160
+5186
+4313
+4579
+2978
+6075
+5821
+3288
+
+2456
+1103
+2492
+1484
+3089
+2519
+2596
+3462
+4707
+2403
+5042
+2345
+1841
+3924
+3674
+
+15955
+14482
+19975
+7828
+
+7686
+33030
+
+9367
+6387
+4450
+1301
+6652
+
+2436
+8020
+9634
+1189
+
+13768
+4937
+6445
+2333
+8688
+2282
+
+2632
+2386
+1540
+1313
+5560
+3191
+3768
+6455
+1771
+5707
+6503
+3702
+2690
+6410
+
+4254
+9381
+10720
+6622
+4502
+3229
+
+10702
+25975
+21218
+
+1824
+3787
+1017
+3211
+1954
+3263
+1654
+5116
+5383
+6081
+5917
+3708
+3770
+3332
+1564
+
+8659
+
+1918
+13752
+13443
+2032
+8928
+
+8167
+4650
+4066
+8487
+5484
+2973
+1974
+8716
+3918
+6829
+
+8569
+4604
+3930
+4567
+15587
+
+8510
+8686
+2757
+10057
+2681
+7895
+6610
+10350
+
+27009
+
+3554
+8125
+6661
+1517
+1293
+6747
+3910
+4998
+3100
+
+58602
+
+2960
+5646
+4133
+3192
+5660
+3224
+4699
+6106
+4147
+4855
+1950
+1195
+5861
+3613
+5095
+
+2481
+11509
+
+9922
+2887
+1722
+10604
+6329
+6330
+3934
+5424
+
+7492
+6265
+3838
+8041
+6266
+4794
+2524
+6684
+2734
+7338
+
+6263
+8780
+6447
+20087
+
+6388
+9789
+4219
+6199
+1753
+7765
+2130
+5475
+
+6043
+4380
+7928
+3807
+5877
+1736
+6191
+4348
+5699
+2381
+
+2683
+4364
+6323
+2128
+3828
+1657
+3885
+3426
+6137
+4427
+2592
+6245
+6142
+5680
+
+4812
+8631
+7556
+6549
+4494
+7671
+2664
+3702
+3551
+1289
+
+8546
+
+5793
+8055
+4733
+3781
+4359
+1127
+5052
+7333
+1533
+3232
+6713
+
+9850
+
+6386
+8256
+12527
+10704
+11625
+6314
+
+36312
+9909
+
+2500
+5131
+12716
+2449
+10252
+2989
+
+10080
+7372
+4650
+4148
+1543
+7025
+4075
+5975
+
+6493
+1969
+3498
+5752
+5231
+5688
+3805
+2245
+3355
+7015
+2001
+1980
+
+5498
+10487
+6072
+5136
+4464
+1645
+
+5765
+1637
+4963
+3317
+2151
+4765
+4234
+4268
+3791
+1371
+5906
+5800
+4684
+5872
+1032
+
+7693
+5165
+3321
+7593
+6652
+4856
+7244
+3238
+5442
+6728
+
+8940
+2746
+4620
+4575
+1794
+8580
+6018
+1198
+2470
+
+10302
+5070
+4341
+2533
+4345
+11497
+
+11333
+1604
+6233
+6784
+5614
+10283
+5386
+
+2715
+3782
+4739
+5782
+3541
+3544
+3591
+4748
+7392
+3361
+5764
+6413
+
+9117
+1201
+6914
+1214
+3645
+3711
+1825
+10249
+
+4719
+8388
+1460
+4555
+1038
+8967
+2147
+2943
+
+3372
+3381
+3607
+5180
+2115
+1071
+2218
+5102
+3133
+5809
+3920
+2758
+1729
+2132
+
+1332
+6802
+5791
+3281
+6624
+1692
+5105
+5160
+3082
+6840
+1613
+4749
+
+5211
+2825
+6050
+2913
+2542
+2466
+2411
+2101
+5822
+1972
+3409
+2738
+5032
+5715
+
+8421
+5749
+1746
+1424
+4398
+5048
+1450
+2122
+7937
+4488
+
+17962
+
+1415
+5018
+11466
+17007
+
+8818
+9115
+4789
+1919
+8398
+3807
+
+13697
+10141
+5675
+2146
+1954
+6312
+
+8363
+2872
+1505
+7354
+1868
+3313
+6657
+3468
+7434
+
+2157
+2904
+3745
+6707
+4194
+2956
+5377
+3130
+7664
+7595
+7477
+
+22149
+
+5662
+4865
+5971
+6008
+6761
+5764
+4321
+1546
+1705
+6056
+3990
+3953
+
+7794
+1246
+5418
+2460
+7858
+6992
+5897
+3459
+2915
+2227
+1517
+
+7873
+3664
+6050
+9000
+8922
+8817
+4514
+
+20975
+
+4983
+11133
+4400
+6751
+2763
+2781
+11806
diff --git a/resources/day01_sample.txt b/resources/day01_sample.txt
new file mode 100644
index 0000000..2094f91
--- /dev/null
+++ b/resources/day01_sample.txt
@@ -0,0 +1,14 @@
+1000
+2000
+3000
+
+4000
+
+5000
+6000
+
+7000
+8000
+9000
+
+10000
diff --git a/src/aoc_2022/day01.clj b/src/aoc_2022/day01.clj
new file mode 100644
index 0000000..c26c87c
--- /dev/null
+++ b/src/aoc_2022/day01.clj
@@ -0,0 +1,34 @@
+(ns aoc-2022.day01)
+(require '[clojure.java.io :as io])
+
+(defn split-by [delim acc coll]
+ (let [head (first coll)
+ tail (rest coll)]
+ (if (nil? head)
+ [acc]
+ (cond
+ (= delim head) (cons (reverse acc) (split-by delim [] tail))
+ :else (split-by delim (cons head acc) tail)))))
+
+(defn task1 [rows]
+ (->> rows
+ (map (fn [row] (if (not (empty? row)) (Long/valueOf row) "")))
+ (split-by "" [])
+ (map (fn [calories] (reduce + calories)))
+ (reduce max)))
+
+(defn task2 [rows]
+ (->> rows
+ (map (fn [row] (if (not (empty? row)) (Long/valueOf row) "")))
+ (split-by "" [])
+ (map (fn [calories] (reduce + calories)))
+ sort
+ reverse
+ (take 3)
+ (reduce +)))
+
+(with-open [rdr (io/reader "resources/day01_actual.txt")]
+ (let [rows (line-seq rdr)]
+ (do
+ (println "task1:" (task1 rows))
+ (println "task2:" (task2 rows)))))