# Advent of Code

Advent of Code is an Advent calendar of small programming puzzles for a range of skill levels that can be solved in any programming language.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Results from the Advent of FPGA Challenge

DevFeed: [Results from the Advent of FPGA Challenge](<https://devfeed.tech/articles/results-from-the-advent-of-fpga-challenge-20148.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/advent-of-fpga-challenge-2025-results/>)

Author: Anish Singhani

Published: 2026-02-11T00:00:00Z

Content type: article

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [fpga](<https://devfeed.tech/topics/fpga.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Hardware](<https://devfeed.tech/topics/hardware.md>), [Verilog](<https://devfeed.tech/topics/verilog.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [competition](<https://devfeed.tech/tags/competition.md>), [fpga](<https://devfeed.tech/tags/fpga.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [writeup](<https://devfeed.tech/tags/writeup.md>)

### AI overview

Jane Street reports the results of its Advent of FPGA Challenge, a hardware-design competition run alongside Advent of Code. The article describes participation statistics, the hardware description languages used, and examples of notable submissions.

### Source excerpt

At the end of last year, we decided to try something new: a challenge that would run alongside Advent of Code, where we asked the community to show us how they could design hardware to solve the same problems. We had no idea what level of participation to expect, but we received a huge number of submissions, many of which were incredibly creative!

## Solving the "Impossible" in ClickHouse: Advent of Code 2025

DevFeed: [Solving the "Impossible" in ClickHouse: Advent of Code 2025](<https://devfeed.tech/articles/solving-the-impossible-in-clickhouse-advent-of-code-2025-5061.md>)

Original publisher: [Read original article](<https://clickhouse.com/blog/clickhouse-advent-of-code-2025>)

Author: Zach Naimon

Published: 2025-12-31T00:00:00Z

Content type: article

Language: en

Sources: [ClickHouse Blog](<https://devfeed.tech/sources/clickhouse-blog.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Bash](<https://devfeed.tech/topics/bash.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [ascii](<https://devfeed.tech/tags/ascii.md>), [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [database](<https://devfeed.tech/tags/database.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

The article describes solving Advent of Code 2025 puzzles with a single pure ClickHouse SQL query. It outlines constraints including raw-input parsing and no UDFs or intermediate tables.

### Source excerpt

At ClickHouse, we don't like the word "impossible." We believe that with the right tools, everything is a data problem. To prove it, we decided to complete the 2025 Advent of Code unconventionally: using pure ClickHouse SQL.

## Why Ruby Is Well Suited for Advent of Code

DevFeed: [Why Ruby Is Well Suited for Advent of Code](<https://devfeed.tech/articles/why-ruby-is-the-best-language-for-advent-of-code-20121.md>)

Original publisher: [Read original article](<https://hashrocket.com/blog/posts/why-ruby-is-the-best-language-for-advent-of-code>)

Author: Tony Yunker

Published: 2025-12-02T14:00:00Z

Content type: opinion

Language: en

Sources: [Hashrocket](<https://devfeed.tech/sources/hashrocket.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [programming](<https://devfeed.tech/tags/programming.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [standard-library](<https://devfeed.tech/tags/standard-library.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

### AI overview

This opinion article explains why the author prefers Ruby for Advent of Code programming puzzles, highlighting Ruby's flexibility, data structures, standard library, and tooling. It also notes that Ruby's metaprogramming can cause bugs in larger production codebases.

### Source excerpt

It's the most wonderful time of the year - Christmas Advent of Code time! Advent of Code is an Advent Calendar style series of programming puzzles put out each year, starting on December 1st leading up to Christmas. The puzzles are super festive and ramp up in difficulty over the course of the month. Programmers of every level can participate, and in researching some of the more difficult problems you'll probably learn something cool! It's a great way to finish out the year. I've been taking part in Advent of Code since 2019 (I've never completed a full year - and that's ok! You can participate for as long as it's fun and have the time) and have tried solving in multiple different languages - Advent is a great way to learn/skill up in a new language. But Ruby remains my favorite language in which to solve these puzzles. Many of Ruby's strengths - its flexibility, robust standard library, and tooling make it the ideal language for Advent of Code. Flexibility Ruby doesn't enforce any one way of writing code. Want to solve a problem with a procedural script? Go for it! Want to leverage object-oriented programming and send messages between classes? Can do! Want to write in a functional style and map and zip a data structure in one long chain? You can do that too! And you can mix and match paradigms between problems - whatever models each problem best. Ruby's data structures are super flexible as well. In many of the problems, Array and Hash allow you to very quickly model solutions. But if you find a hash isn't quite cutting it and you don't want to upgrade it to a full class, you can use the Data class to create value objects. This will lend you a bit more structure than a hash, and allow you to encapsulate some logic inside it without having to bring in the overhead of a Class. Some of Ruby's flexibility - metaprogramming in particular - can be...unpopular... in larger production codebases. It's the "magic" that can lead to some nasty bugs. But Advent is a great place

## Advent of FPGA -- A Jane Street Challenge

DevFeed: [Advent of FPGA -- A Jane Street Challenge](<https://devfeed.tech/articles/advent-of-fpga-a-jane-street-challenge-20149.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/advent-of-fpga-challenge-2025/>)

Author: Anish Singhani

Published: 2025-11-24T00:00:00Z

Content type: release

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [fpga](<https://devfeed.tech/topics/fpga.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [code](<https://devfeed.tech/tags/code.md>), [fpga](<https://devfeed.tech/tags/fpga.md>), [open-source](<https://devfeed.tech/tags/open-source.md>)

### AI overview

Jane Street announces the 2025 Advent of FPGA Challenge, inviting participants to implement Advent of Code puzzles as synthesizable RTL with realistic I/O. Submissions must include open-source code, a testbench, and documentation, with Hardcaml encouraged but other RTL languages accepted.

### Source excerpt

Update: We got over 200 submissions to this challenge, spanning a wide variety of HDL languages and hardware platforms! We featured our favorite submissions in the results blog post, check it out here

## Advent of Hardcaml

DevFeed: [Advent of Hardcaml](<https://devfeed.tech/articles/advent-of-hardcaml-20150.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/advent-of-hardcaml-2024/>)

Author: Anish Singhani

Published: 2025-03-22T00:00:00Z

Content type: article

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [fpga](<https://devfeed.tech/topics/fpga.md>), [Reason](<https://devfeed.tech/topics/reason.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Simulation](<https://devfeed.tech/topics/simulation.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [fpga](<https://devfeed.tech/tags/fpga.md>), [ocaml](<https://devfeed.tech/tags/ocaml.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [programming](<https://devfeed.tech/tags/programming.md>), [simulation](<https://devfeed.tech/tags/simulation.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

A Jane Street developer describes implementing Advent of Code 2024 puzzles on an FPGA using Hardcaml, an open-source hardware description language embedded in OCaml. The article discusses adapting algorithms to FPGA constraints and using Hardcaml for simulation, RTL compilation, hardware design, and synthesis.

### Source excerpt

Update: For the 2025 Advent of Code, we ran an Advent of FPGA Challenge where we invited the community to implement their own synthesizable solutions to this year's puzzles! We got over 200 submissions spanning a wide variety of HDL languages and hardware platforms, check out our favorite solutions in the results blog post

## Advent of Code 2024 in pure SQL

DevFeed: [Advent of Code 2024 in pure SQL](<https://devfeed.tech/articles/advent-of-code-2024-in-pure-sql-25086.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2024/12/advent-of-code-2024-in-pure-sql.html>)

Author: Thomas Neumann (noreply@blogger.com)

Published: 2024-12-27T16:57:00Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [duckdb](<https://devfeed.tech/tags/duckdb.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>), [recursive-sql](<https://devfeed.tech/tags/recursive-sql.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

The author describes solving every Advent of Code 2024 problem in pure SQL. Small-scale traversals were practical and sometimes pleasant, while larger recursive queries could be inefficient and require more than 200 GB of memory. The experience suggests that recursive SQL would benefit from mechanisms for updating state and supporting more complex control flow.

### Source excerpt

On a whim I decided to do this years advent of code in pure SQL. That was an interesting experience that I can recommend to everybody because it forces you to think differently about the problems. And I can report that it was possible to solve every problem in pure SQL. In many cases SQL was actually surprisingly pleasant to use. The full solution for day 11 (including the puzzle input) is shown below: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30with recursive aoc10_input(i) as (select ' 89010123 78121874 87430965 96549874 45678903 32019012 01329801 10456732 '), lines(y,line) as ( select 0, substr(i,1,position(E'\n' in i)-1), substr(i,position(E'\n' in i)+1) from aoc10_input union all select y+1,substr(r,1,position(E'\n' in r)-1), substr(r,position(E'\n' in r)+1) from lines l(y,l,r) where position(E'\n' in r)>0 ), field(x,y,v) as ( select x,y,ascii(substr(line,x::integer,1))-48 from (select * from lines l where line<>'') s, lateral generate_series(1,length(line)) g(x) ), paths(x,y,v,sx,sy) as ( select x,y,9,x,y from field where v = 9 union all select f.x,f.y,f.v,p.sx,p.sy from field f, paths p where f.v=p.v-1 and ((f.x=p.x and abs(f.y-p.y)=1) or (f.y=p.y and abs(f.x-p.x)=1)) and p.v>0), results as (select * from paths where v=0), part1 as (select distinct * from results) select (select count(*) from part1) as part1, (select count(*) from results) as part2 Parsing the input is a bit painful in SQL, but it is not too bad. Lines 1-10 are simply the puzzle input, lines 11-17 split the input into individual lines, and lines 18-21 construct a 2D array from the input. The algorithm itself is pretty short, lines 22-27 perform a recursive traversal of the field, and lines 28-39 extract the puzzle answer from the traversal results. For this kind of small scale traversals SQL works just fine. Other days were more painful. Day 16 for example does conceptually a very similar traversal of a field, and it computes the minimal traversal distance

## Advent of Svelte

DevFeed: [Advent of Svelte](<https://devfeed.tech/articles/advent-of-svelte-3027.md>)

Original publisher: [Read original article](<https://svelte.dev/blog/advent-of-svelte>)

Author: The Svelte team

Published: 2024-12-01T00:00:00Z

Content type: article

Language: en

Sources: [Svelte blog](<https://devfeed.tech/sources/svelte-blog.md>)

Topics: [Svelte](<https://devfeed.tech/topics/svelte.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Code](<https://devfeed.tech/topics/code.md>), [Accessibility](<https://devfeed.tech/topics/accessibility.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [browser](<https://devfeed.tech/tags/browser.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [new-feature](<https://devfeed.tech/tags/new-feature.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [svelte](<https://devfeed.tech/tags/svelte.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

Svelte Society's Advent of Svelte presents a daily series of Svelte, SvelteKit, and website improvements released through Christmas. The documented updates include error boundaries, simpler each blocks, exported snippets, configurable form default values, reactive media-query helpers, modern Spring and Tween state alternatives, an accessible hierarchical tutorial menu, binding transformations, documentation links for warnings and errors, and awaited asynchronous SvelteKit startup setup.

### Source excerpt

Last December, Svelte Society presented an advent calendar's worth of festive Svelte-themed code challenges. This year, we're turning it around: you get to relax while we take on a challenge. We've set ourselves a goal of releasing one thing a day from here until Christmas, whether it's a new feature in Svelte or SvelteKit or an improvement to the website. Follow @svelte.dev and @sveltesociety.dev and check back every day to see what we've been cooking up. Day 1: error boundaries This is a long-awaited and much-requested feature, that allows you to isolate and recover from errors that occur during rendering. docs tutorial Day 2: each without as If you just want to render something in an {#each ...} block n times, and don't care about the value, you can now omit the as part. docs demo Day 3: exported snippets You can now export snippets from a component's <script module>, for use in other components, as long as those snippets don't reference anything belonging to the component instance. docs demo Day 4: form control default values When you reset a form, the value of each <input> element reverts to its defaultValue. This is normally the empty string, but you can now control it directly in your template. docs demo Day 5: MediaQuery, prefersReducedMotion and createSubscriber It's a three-in-one kind of day. new MediaQuery(...) gives you an object with a reactive current property that's true when the media query matches. prefersReducedMotion is an instance of MediaQuery that matches if the user has expressed a preference for reduced motion, helping you build accessible apps. Under the hood, both are using the createSubscriber mechanism, which gives you an easy way to set up event listeners when a value is read inside an effect. createSubscriber docs MediaQuery docs prefersReducedMotion docs demo Day 6: Spring and Tween We now have modern state-based alternatives to the spring and tweened stores of old. Smooth! Tween tutorial Spring tutorial docs demo Day 7: better tutori

## Advent of Code in C++ Template Metaprogramming

DevFeed: [Advent of Code in C++ Template Metaprogramming](<https://devfeed.tech/articles/advent-of-code-in-c-template-metaprogramming-21942.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/post/advent-of-templates/>)

Author: Nelson Elhage

Published: 2023-12-08T15:30:00Z

Content type: tutorial

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [polyfill](<https://devfeed.tech/topics/polyfill.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [polyfill](<https://devfeed.tech/tags/polyfill.md>), [writeup](<https://devfeed.tech/tags/writeup.md>)

### AI overview

An annotated walkthrough of solving the first Advent of Code problem using purely compile-time C++ template metaprogramming. It covers compile-time input handling, folds, helper types, and state tracking to calculate calibration values.

### Source excerpt

This December, the imp of the perverse struck me, and I decided to see how many days of Advent of Code I could do purely in compile-time C++ metaprogramming. As of this writing, I've done two days, and I'm not sure I'll make it any further. However, that's one more day than I planned to do as of yesterday, which is in turn further than I thought I'd make it after my first attempt.

## Using Fleet 1.19's AI Assistant to Convert Kotlin Between Imperative and Functional Styles

DevFeed: [Using Fleet 1.19's AI Assistant to Convert Kotlin Between Imperative and Functional Styles](<https://devfeed.tech/articles/the-imitation-tortoise-s-song-a-fleety-conversion-from-imperative-to-functional-will-you-join-the-dance-32082.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/the-imitation-tortoises-song-a-fleety-conversion-from-imperative-to-functional-will-you-join-the-dance/>)

Published: 2023-06-10T13:12:44Z

Content type: article

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [coding style](<https://devfeed.tech/topics/coding-style.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [coding](<https://devfeed.tech/topics/coding.md>), [Code](<https://devfeed.tech/topics/code.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-assistant](<https://devfeed.tech/tags/ai-assistant.md>), [code](<https://devfeed.tech/tags/code.md>), [coding-style](<https://devfeed.tech/tags/coding-style.md>), [doggerel](<https://devfeed.tech/tags/doggerel.md>), [fleet](<https://devfeed.tech/tags/fleet.md>), [functional](<https://devfeed.tech/tags/functional.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [imperative](<https://devfeed.tech/tags/imperative.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [word-games](<https://devfeed.tech/tags/word-games.md>)

### AI overview

The article experiments with Fleet 1.19's integrated AI assistant by converting Kotlin code for the Advent of Code 2022 Day 10 puzzle between imperative and functional styles, comparing the results, and generating poetry.

### Source excerpt

Once upon a time I admit. I have a penchant for word games and weird segues. So I will tell you what this post is about off the bat. You can skip to the code, I won't be offended. Fleet 1.19 was released this week with an integrated AI assistant. I took it for a spin and used it to convert Kotlin code from imperative style to functional and back again. I used some Kotlin code, which solves the Advent of Code 2022 Day 10 puzzle. I had written the solution in two styles and I had the AI assistant do the same conversion and compared the code. And then I played around and generated some poetry. Follow links at your peril, there are rabbit holes, it might make you late or change the size of your free time. Segue the first of many Oh you are still here! You didn't jump to the code starts here section? Why am I doing this? A long time ago, I read a lot of Lewis Caroll, Alice in Wonderland. In one scene Alice talks to the Mock Turtle. He sings a song about sea creatures dancing. When the first language translators appeared on the scene, Altavisa babelfish or perhaps it was the early Google Translate, I converted passages from Alice in Wonderland to French and then back again to see what the machines could do. The Mock Turtle was transformed into an Imitation Tortoise. In this way the reference to the original mock turtle soup was lost in translation. In a roundabout way I was wondering what would be uncovered or lost if I used the AI assistant for some translations in coding style. Couplets of doggerel My trusty and non emotional assistant had no opinion on Lewis Caroll but it made this for me. A definition of functional programming style in rhyming couplets: Functional programming's way, treats functions as the play. Immutable states they use, side effects they refuse. Declarative code is their choice, with functions, they rejoice. Nested functions map, filter, reduce, a clean, elegant code they produce. Compare this with the imperative version: Imperative code, step by st

## 26 programming languages in 25 days, Part 1: Strategy, tactics and logistics

DevFeed: [26 programming languages in 25 days, Part 1: Strategy, tactics and logistics](<https://devfeed.tech/articles/26-programming-languages-in-25-days-part-1-strategy-tactics-and-logistics-35232.md>)

Original publisher: [Read original article](<http://matt.might.net/articles/26-languages-part1/>)

Published: 2022-12-27T23:28:42Z

Content type: article

Language: en

Sources: [Matt Might](<https://devfeed.tech/sources/matt-might.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Learning](<https://devfeed.tech/topics/learning.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [code](<https://devfeed.tech/tags/code.md>), [languages](<https://devfeed.tech/tags/languages.md>), [learning](<https://devfeed.tech/tags/learning.md>), [programming](<https://devfeed.tech/tags/programming.md>), [strategy](<https://devfeed.tech/tags/strategy.md>)

### AI overview

The author describes solving Advent of Code's 25 daily puzzles with a different programming language each day, using 26 languages in total. The article explains the strategy, language ranking, reserves, and lessons from learning unfamiliar languages during the contest.

### Source excerpt

Since making a sudden leap from computer science to academic medicine about seven years ago, I haven't programmed as much. I love what I do in medicine and biology, and I love helping patients. But, I have missed programming - and programming languages. Then I came across the Advent of Code on Mastodon - a series of daily two-part puzzles for programmers that runs for 25 days. On a whim, I solved the Day 1 puzzle using awk. I solved Day 2 in TeX (which underpins LaTeX) to reboot an old skill. After that, I wondered if I could solve each of the 25 puzzles using a different programming language every day. So, I did. In the end: on 12 days, I had to learn a new programming language from scratch, and then use it to solve that day's puzzle; on 4 days, I used languages where I had very little experience; and on the other 9 days, I used languages I had known well at some point. In the end, I used 26 languages, because I combined two on Day 21 (sed and bc), turning the experience into a rapid-fire "breadth-first search" of programming language space. Learning how to learn a new language became the key meta-learning. If you'd like to try the breadth-first search yourself, I have distilled advice on the strategy, tactics and logistics involved in using a new programming language every day for 25 days. You will end up with an appreciation of the relative strengths and intended domains of different languages. Click here to read the rest of the article

## Saving Christmas with Kotlin

DevFeed: [Saving Christmas with Kotlin](<https://devfeed.tech/articles/saving-christmas-with-kotlin-24739.md>)

Original publisher: [Read original article](<https://medium.com/xorum-io/saving-christmas-with-kotlin-e3e239b6fe3d?source=rss----92bb7980cc9f---4>)

Author: Yev Kanivets

Published: 2022-01-29T12:24:13Z

Content type: tutorial

Language: en

Sources: [xorum.io - Medium](<https://devfeed.tech/sources/xorum-io-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [competitive-programming](<https://devfeed.tech/topics/competitive-programming.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [competitive-programming](<https://devfeed.tech/tags/competitive-programming.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

A developer describes using Kotlin to complete all 50 challenges of Advent of Code 2021 over 25 days and shares links to a four-part series of Kotlin ideas and solutions. The article also discusses Kotlin's suitability for competitive programming.

### Source excerpt

It's been a month since I've saved a Christmas. Now, I feel it's time to tell you exactly how I did it. I wasn't alone, though. My faithful companion was crucial to the success of my mission. Yes, Kotlin, I'm talking about you. But let's return to the day when it all started: I was minding my own business on a ship at sea when the overboard alarm goes off! I rushed to see if I could help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean!Before I knew it, I was inside a submarine the Elves kept ready for situations like this. It was covered in Christmas lights (because of course it is), and it even had an experimental antenna that should be able to track the keys if I could boost its signal strength high enough; there was a little meter that indicated the antenna's signal strength by displaying 0-50 stars.My instincts told me that in order to save Christmas, I needed to get all fifty stars by December 25th. It turns out that 200K+ other people happened to get into a similar situation. You can still see the complete log of our adventures on this site. Some people call it the "Advent of Code" and say it happens yearly. My way down It took me 25 days and 50 challenges (yeah, two challenges per day) to get those sleigh keys and save the Christmas. Every day at 7 a.m. (UTC+2), we reached a new milestone that unlocked two more challenges to solve. Most of them took from one to two hours to get done. Thank God there was a pretty good Internet connection in my submarine (I could even work remotely and didn't need to take a vacation for such a noble task), so I still had plenty of time to share my ideas and solutions: Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 1/4 Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 2/4 Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 3/4 Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 4/4 Spending 25 days locked in a submarine and solving chall

## Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 4/4

DevFeed: [Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 4/4](<https://devfeed.tech/articles/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-4-4-24736.md>)

Original publisher: [Read original article](<https://medium.com/xorum-io/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-4-4-75c207692bdb?source=rss----92bb7980cc9f---4>)

Author: Yev Kanivets

Published: 2021-12-26T14:39:41Z

Content type: tutorial

Language: en

Sources: [xorum.io - Medium](<https://devfeed.tech/sources/xorum-io-medium.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [3D](<https://devfeed.tech/topics/3d.md>), [pixel](<https://devfeed.tech/topics/pixel.md>)

Tags: [3d](<https://devfeed.tech/tags/3d.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [array](<https://devfeed.tech/tags/array.md>), [beacon](<https://devfeed.tech/tags/beacon.md>), [competitive-programming](<https://devfeed.tech/tags/competitive-programming.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [pixel](<https://devfeed.tech/tags/pixel.md>), [points](<https://devfeed.tech/tags/points.md>), [scanner](<https://devfeed.tech/tags/scanner.md>), [solutions](<https://devfeed.tech/tags/solutions.md>)

### AI overview

A Kotlin walkthrough of Advent of Code 2021 tasks 19 and 20. It explains matching rotated point sets in 3D space using beacon intersections, then enhancing an image represented as a 2D pixel array while accounting for infinite padding and changing background values.

### Source excerpt

Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 4/4 The final week of Advent of Code was, obviously, the most challenging one. To be honest I was close to being happy with just a silver star multiple times. But at the end, tenacity made the difference. 50 stars are mine this year 🌟 Ideas and Solutions for tasks 1 to 6 can be found here, for tasks 7 to 12 -- here, for tasks 13 to 18 -- here. Day 19: Beacon Scanner We are provided with several sets of points in 3D space. Those points are rotated differently in each set, so we don't know how X, Y, and Z coordinates are aligned between sets. Our goal is to merge all those sets into a single group by matching points (sub-task one) and find the most significant distance between coordinate origins after they are matched. Here is the complete task. This is an exciting task! I've initially learned about this idea from The Three-Body Problem book, which introduced the concept of locating any star in the Universe by the distances from a few nearest stars -- in our case, "a few" means 12. Think about it as a star fingerprint ;) So to match the sets of points in 3D space, we need: check all combinations of rotations in three dimensions (in our task, the step is 90 degrees, so there are 48 combinations) for the whole set assume that each pair of points from the first set and the second set is an intersection by adjusting all points to that pair check how many adjusted points intersect between the two sets if there are more than 12 intersections, voilá -- the sets are matched The embedded Kotlin's functions like intersect, map, and mapNotNull make the solution, even for such a complex task, elegant. Day 20: Trench Map This image-enhancing task provides us with the initial photo (2D array of black and white pixels), and enhancing guidance (1D array). Enhancing happens in steps, where for each pixel, we found its enhanced value as a result of a combination of itself + all eight adjacent pixels. Here is the complete task. We

## Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 3/4

DevFeed: [Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 3/4](<https://devfeed.tech/articles/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-3-4-24735.md>)

Original publisher: [Read original article](<https://medium.com/xorum-io/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-3-4-dbfd577703cc?source=rss----92bb7980cc9f---4>)

Author: Yev Kanivets

Published: 2021-12-26T14:22:49Z

Content type: tutorial

Language: en

Sources: [xorum.io - Medium](<https://devfeed.tech/sources/xorum-io-medium.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [competitive-programming](<https://devfeed.tech/topics/competitive-programming.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [math](<https://devfeed.tech/topics/math.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [array](<https://devfeed.tech/tags/array.md>), [code](<https://devfeed.tech/tags/code.md>), [competitive-programming](<https://devfeed.tech/tags/competitive-programming.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [graph-theory](<https://devfeed.tech/tags/graph-theory.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [memory](<https://devfeed.tech/tags/memory.md>), [pairs](<https://devfeed.tech/tags/pairs.md>), [programming](<https://devfeed.tech/tags/programming.md>), [solutions](<https://devfeed.tech/tags/solutions.md>), [time](<https://devfeed.tech/tags/time.md>)

### AI overview

This article presents high-level ideas and Kotlin solutions for Advent of Code 2021 tasks from days 13 to 15. It discusses folding a 2D array, modeling polymer growth with dynamic programming, and finding a shortest path in a 2D array.

### Source excerpt

Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 3/4 The third week of Advent of Code requires more time and even some competitive programming knowledge like dynamic programming and graph theory. In this article, I share some high-level ideas and my solutions if you need a hint or a few to get that gold star. Ideas and Solutions for tasks 1 to 6 can be found here, for tasks 7 to 12 -- here. Day 13: Transparent Origami The 2D array contains two types of symbols -- . and #. This array can be folded horizontally and vertically multiple times. When folding # symbols replace . symbols, but not vice versa. Here is the complete task. This is a modeling task, which you can do on the 2D array itself, but the possible range is quite large, so you can hit a memory limit. The smarter solution would be to fold the # symbols (the initial input, actually). Such folding can be done with Kotlin's fold function using the initial value of # symbol positions and mapNotNull, which mirrors X or Y coordinates depending on the fold direction. Here is my solution. Day 14: Extended Polymerization We get the initial string (template) consisting of uppercase letters, which describe the initial state of the polymer. The list of pair insertion rules allows growing the initial polymer step by step exponentially. We need to model this growth during 10 (first sub-task) and 40 (second sub-task) steps. Here is the complete task. The first sub-task can be solved just by modeling, but even 20 steps are too long and require too much memory and time. The (much) better solution is based on dynamic programming. You can easily see that every pair grows independently of others (new elements are always added inside the pair). It means that the solution can be found for each pair separately and then combined. It doesn't speed up things sufficiently though. But makes the solution easier? Yes. Now, let's grow each pair step by step. So at each step, every pair (usually) produces two more pairs, which h

## Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 2/4

DevFeed: [Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 2/4](<https://devfeed.tech/articles/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-2-4-24734.md>)

Original publisher: [Read original article](<https://medium.com/xorum-io/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-2-4-5079d5066653?source=rss----92bb7980cc9f---4>)

Author: Yev Kanivets

Published: 2021-12-18T19:56:15Z

Content type: tutorial

Language: en

Sources: [xorum.io - Medium](<https://devfeed.tech/sources/xorum-io-medium.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Algorithms, Complexity](<https://devfeed.tech/topics/algorithms-complexity.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [algorithms-and-data-structures](<https://devfeed.tech/tags/algorithms-and-data-structures.md>), [competetive-programming](<https://devfeed.tech/tags/competetive-programming.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [graph](<https://devfeed.tech/tags/graph.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

### AI overview

This article presents ideas and partial solutions for Advent of Code 2021 tasks 7 through 9 in Kotlin. It discusses minimizing alignment cost for an array, decoding malfunctioning seven-segment displays, and locating low points and basins in a two-dimensional digit map using breadth-first or depth-first search.

### Source excerpt

Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 2/4 The second week of Advent of Code introduces us to more difficult tasks, some of which require fundamental knowledge in algorithms and data structures. Do you need an idea or a tiny hint to get that gold star? Here we are, the second six tasks. What's special about this article? I won't be sharing the complete editorial, but the key idea only, so you can still solve the task by yourself. And if you need more guidance, there is a source code linked. Ideas and Solutions for tasks 1 to 6 can be found here. Day 7: The Treachery of Whales We are provided with an array of different values, which we need to align to a single value with the lowest possible cost. The cost function is different for the two sub-tasks. Here is the complete task. The solution is as simple as checking all possible values to align from min value to max value in the original array and choosing one with the lowest cost. The cost function (array of cost of moving value by 0, 1, 2 ... N) can be passed as an argument to your solution. Here is my solution. Day 8: Seven Segment Search Malfunctioning seven-segment digital display sends us some signals, which we need to decode knowing the representation of the full set of digits and which segments are used for each entry. Here is the complete task. The first sub-task requires you to parse only four digits -- 1, 4, 7, 8. All of them are unique in terms of segments used, so guessing them is relatively simple. The second sub-task asks you to guess the other 6 digits. I'm sure there are many different sequences in which you can guess them, but in my case, I've done the following: segments b and d are present in digit 4, but not in digit 1 segment bd is present only in digit 5 between all digits that use 5 segments then we can decode segments c and f by looking on the intersection of digits 1 and 5 using newly discovered segments, we find digits 3, 2, and 6 segment d can be found as an intersection o

## Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 1/4

DevFeed: [Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 1/4](<https://devfeed.tech/articles/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-1-4-24733.md>)

Original publisher: [Read original article](<https://medium.com/xorum-io/ideas-and-solutions-for-advent-of-code-2021-in-kotlin-part-1-4-9a16d9e3bd57?source=rss----92bb7980cc9f---4>)

Author: Yev Kanivets

Published: 2021-12-13T15:31:55Z

Content type: tutorial

Language: en

Sources: [xorum.io - Medium](<https://devfeed.tech/sources/xorum-io-medium.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [array](<https://devfeed.tech/tags/array.md>), [commands](<https://devfeed.tech/tags/commands.md>), [competitive-programming](<https://devfeed.tech/tags/competitive-programming.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [map](<https://devfeed.tech/tags/map.md>), [programming](<https://devfeed.tech/tags/programming.md>), [solutions](<https://devfeed.tech/tags/solutions.md>)

### AI overview

A Kotlin-focused walkthrough of the first six Advent of Code 2021 puzzles. It explains the key solution ideas for the early tasks, including array comparisons, submarine movement modeling, and binary-number calculations, while linking to source code for further guidance.

### Source excerpt

Ideas and Solutions for Advent of Code 2021 in Kotlin -- Part 1/4 There are so many things to do before Christmas, so I was always wondering how people find extra time to solve a daily programming puzzle of Advent of Code. Well, this year I'm one of those lucky folks with a bunch of spare time. Advent of Code is an annual event of Christmas-oriented programming challenges started December 2015. Every year since then, on the first day of December, a programming puzzle is published every day for twenty-four days. You can solve the puzzle and provide an answer using the language of your choice. Extra reason by JetBrains in the form of the giveaway of some Kotlin care packages has certainly contributed to my motivation. But what's the point of solving tasks without sharing your ideas and solutions with the community ;) So here we are, the first six tasks. What's special about this article? I won't be sharing the complete editorial, but the key idea only, so you can still solve the task by yourself. And if you need more guidance, there is a source code linked. Day 1: Sonar Sweep We are given an array of heights of a seafloor. We need to calculate the number of times heights (sub-task one) and sliding triples of heights (sub-task two) are increasing. Complete task is here. To solve both tasks we need to go from left to right and compare the previous element (or sliding triple) to the current one. That's pretty simple, but challenge yourself to craft the beautiful code. In Kotlin we may consider using drop and foldIndexed functions for this. Here is my solution. Day 2: Dive! The submarine can move in 2D space (horizontal position and depth) controlled by the set of commands. Moves mechanics are slightly different between subtasks, but the overall approach and goal are the same -- model moves and find the resulting position. Complete task is here. The first sub-task can be solved by folding horizontal position and depth changes, but the second sub-task should be modeled exact

## Idiomatic Kotlin: Solving Advent of Code Puzzles, Binary Boarding

DevFeed: [Idiomatic Kotlin: Solving Advent of Code Puzzles, Binary Boarding](<https://devfeed.tech/articles/idiomatic-kotlin-solving-advent-of-code-puzzles-binary-boarding-22984.md>)

Original publisher: [Read original article](<https://dev.to/kotlin/idiomatic-kotlin-solving-advent-of-code-puzzles-binary-boarding-513e>)

Author: Svetlana Isakova

Published: 2021-09-10T08:50:58Z

Content type: tutorial

Language: en

Sources: [Kotlin](<https://devfeed.tech/sources/kotlin-2.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Code Challenge](<https://devfeed.tech/topics/code-challenge.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [100daysofcode](<https://devfeed.tech/tags/100daysofcode.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [adventofcode](<https://devfeed.tech/tags/adventofcode.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [code](<https://devfeed.tech/tags/code.md>), [code-challenge](<https://devfeed.tech/tags/code-challenge.md>), [codenewbie](<https://devfeed.tech/tags/codenewbie.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

A Kotlin tutorial solves Advent of Code 2020 Day 5, Binary Boarding. It explains how boarding-pass characters encode rows and columns as binary values, then uses seat IDs to identify the highest seat ID and the missing seat.

### Source excerpt

Let's continue our journey of understanding what "idiomatic Kotlin" means and solve one more puzzle from the Advent of Code challenge. The puzzles are independent of each other, so you don't need to check any of the previous ones we've already covered. Simply read through the following solution or watch the video. We hope you learn something new! Day 5. Binary Boarding We're boarding the plane! We need to analyze the list of boarding passes and find the seat with the highest seat ID. Then we need to find the one seat missing from the list, which is ours. You can find the full task description at https://adventofcode.com/2020/day/5.* A seat is specified as, for example, FBFBBFFRLR, where F means "front", B means "back", L means "left", and R means "right". The first 7 characters are either F or B and they specify exactly one of the 128 rows on the plane (numbered 0 through 127). The last three characters are either L or R; these specify exactly one of the 8 columns of seats on the plane (numbered 0 through 7). A more detailed encoding description is given on the puzzle page. Every seat has a unique seat ID, calculated by multiplying the row by 8 and then adding the column. The puzzle input is the list of boarding passes. The first task is to find the boarding pass in this list with the highest seat ID. The second task is to find the missing boarding pass in the list. The flight is completely full, there's only one missing boarding pass, and that's our seat. However, some of the seats at the very front and back of the plane don't exist on this aircraft, so they are missing from the list as well. As usual, we suggest that you try to solve the task on your own before reading the solution. Here's how you can set up Kotlin for this purpose. Solution Let's first discuss the encoding of the boarding passes. Note how it is a nicely "hidden" binary representation of natural numbers! Let's take a closer look. Boarding pass: binary representation First, let's look at the rows.

## Idiomatic Kotlin: Solving Advent of Code Puzzles, Passport Validation

DevFeed: [Idiomatic Kotlin: Solving Advent of Code Puzzles, Passport Validation](<https://devfeed.tech/articles/idiomatic-kotlin-solving-advent-of-code-puzzles-passport-validation-22986.md>)

Original publisher: [Read original article](<https://dev.to/kotlin/idiomatic-kotlin-solving-advent-of-code-puzzles-passport-validation-1425>)

Author: Sebastian Aigner

Published: 2021-09-01T14:52:59Z

Content type: tutorial

Language: en

Sources: [Kotlin](<https://devfeed.tech/sources/kotlin-2.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Sanitization](<https://devfeed.tech/topics/sanitization.md>)

Tags: [100daysofcode](<https://devfeed.tech/tags/100daysofcode.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [adventofcode](<https://devfeed.tech/tags/adventofcode.md>), [code](<https://devfeed.tech/tags/code.md>), [codenewbie](<https://devfeed.tech/tags/codenewbie.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [files](<https://devfeed.tech/tags/files.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [software](<https://devfeed.tech/tags/software.md>), [validation](<https://devfeed.tech/tags/validation.md>)

### AI overview

A tutorial on solving Advent of Code 2020 Day 4, Passport Processing, with Kotlin. It explains how to parse passport records separated by blank lines, extract key-value pairs, and count passports containing all required fields.

### Source excerpt

Today in "Idiomatic Kotlin", we're looking at day 4 of the Advent of Code 2020 challenges, in which we tackle a problem that feels as old as programming itself: input sanitization and validation. Day 4. Passport processing We need to build a passport scanner that, given a batch of input text, can count how many passports are valid. You can find the complete task description at https://adventofcode.com/2020/day/4. Like many challenges, we first inspect our input: ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm The input is a batch of travel documents in a text file, separated by blank lines. Each passport is represented as a sequence of key-colon-value pairs separated by spaces or newlines. Our challenge is finding out how many passports are valid. For part one, "valid" means that they need to have all the required fields outlined by the security personnel: byr, iyr, eyr, hgt, hcl, ecl and pid (we conveniently ignore their request to validate the cid field). Solving Day 4, Part 1 Like many challenges, we start by reading our puzzle input as text and trim off any extraneous whitespace at the beginning and the end of the file. As per the description, passports are always separated by blank lines. A blank line is just two "returns", or newlines, in a row, so we'll use this to split our input string into the individual passports: val passports = File("src/day04/input.txt") .readText() .trim() .split("\n\n", "\r\n\r\n") (Note that depending on your operating system, the line separator in text files is different: On Windows, it is \r\n, on Linux and macOS, it's \n. Kotlin's split method takes an arbitrary number of delimiters, allowing us to cover both cases directly.) We now have a list of passport strings. However, working with lists of raw strings can quickly get confusing. Let's use Kotlin's expressiv

## Idiomatic Kotlin: Solving Advent of Code Puzzles, Day 2

DevFeed: [Idiomatic Kotlin: Solving Advent of Code Puzzles, Day 2](<https://devfeed.tech/articles/idiomatic-kotlin-solving-advent-of-code-puzzles-day-2-22985.md>)

Original publisher: [Read original article](<https://dev.to/kotlin/idiomatic-kotlin-solving-advent-of-code-puzzles-day-2-pe2>)

Author: Svetlana Isakova

Published: 2021-07-21T16:25:30Z

Content type: tutorial

Language: en

Sources: [Kotlin](<https://devfeed.tech/sources/kotlin-2.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Code](<https://devfeed.tech/topics/code.md>), [passwords](<https://devfeed.tech/topics/passwords.md>)

Tags: [100daysofcode](<https://devfeed.tech/tags/100daysofcode.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [adventofcode](<https://devfeed.tech/tags/adventofcode.md>), [code](<https://devfeed.tech/tags/code.md>), [codenewbie](<https://devfeed.tech/tags/codenewbie.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [password](<https://devfeed.tech/tags/password.md>), [passwords](<https://devfeed.tech/tags/passwords.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

A tutorial on writing idiomatic Kotlin while solving Advent of Code 2020 Day 2. It explains the two password-policy interpretations: counting letter occurrences within a range, and requiring the letter in exactly one of two specified positions, then begins implementing input parsing and a Kotlin data class for the policy and password.

### Source excerpt

Idiomatic Kotlin: Solving Advent of Code Puzzles, Day 2 Let's continue learning how to write idiomatic Kotlin code by solving the AdventOfCode tasks! Today, we're discussing the solution for the day 2 task. Day 2. Password philosophy We need to confirm that passwords meet the corporate policy. Find the full task description at https://adventofcode.com/2020/day/2*. First, we need to read the input: 1-3 a: abcde 1-3 b: cdefg 2-9 c: ccccccccc Each line contains the password policy and the password. Our task is to check that the password is valid and conforms to the given policy. The policies are different in the first and the second parts of the task. In the first part, the password policy indicates the lowest and highest number of times a given letter must appear for the password to be valid. For example, 1-3 a means that the password must contain a at least once and at most 3 times. In the example, two passwords, the first and the third ones, are valid. The first contains one a, and the third contains nine cs, both within the limits of their respective policies. The second password, cdefg, is invalid, as it contains no instances of b but needs at least 1. In the second part, the policy describes two positions in the password, where 1 means the first character, 2 means the second character, and so on (indexing starts at 1, not 0). Exactly one of these positions must contain the given letter. Other occurrences of the letter are irrelevant. Given the same example list from above: 1-3 a: abcde is valid: position 1 contains a and position 3 does not. 1-3 b: cdefg is invalid: neither position 1 nor position 3 contains b. 2-9 c: ccccccccc is invalid: both positions 2 and position 9 contain c. We should count the number of passwords from the given input that are valid according to the interpretations of the policies. As usual, if you haven't done it, please solve the task yourself first. Here's how you can set up Kotlin for this purpose. Solution First, we should read and pa

## Solving Advent of Code Puzzles in Idiomatic Kotlin

DevFeed: [Solving Advent of Code Puzzles in Idiomatic Kotlin](<https://devfeed.tech/articles/solving-advent-of-code-puzzles-in-idiomatic-kotlin-22987.md>)

Original publisher: [Read original article](<https://dev.to/kotlin/solving-advent-of-code-puzzles-in-idiomatic-kotlin-1m62>)

Author: Svetlana Isakova

Published: 2021-07-15T12:41:37Z

Content type: tutorial

Language: en

Sources: [Kotlin](<https://devfeed.tech/sources/kotlin-2.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>)

Tags: [100daysofcode](<https://devfeed.tech/tags/100daysofcode.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [adventofcode](<https://devfeed.tech/tags/adventofcode.md>), [codenewbie](<https://devfeed.tech/tags/codenewbie.md>), [coding](<https://devfeed.tech/tags/coding.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ide](<https://devfeed.tech/tags/ide.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [intellij-idea](<https://devfeed.tech/tags/intellij-idea.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [software](<https://devfeed.tech/tags/software.md>), [solutions](<https://devfeed.tech/tags/solutions.md>)

### AI overview

A tutorial introduces Advent of Code as a way to practice Kotlin and presents solutions for the 2020 challenges, beginning with Day 1's Report Repair task. It explains how to set up a Kotlin project, use IntelliJ IDEA or an online editor, and solve the task by finding two or three entries that sum to 2020.

### Source excerpt

What's the best way to learn a language other than writing some code with it? Solving fun and short tasks like the ones from Advent of Code might be a great opportunity to practice your language skills, and you can learn a lot if you compare your solutions with how others have solved the same problem. Lots of developers from around the world, including some from the Kotlin team, take part in the Advent of Code challenges created by Eric Wastl. Advent of Code is a series of tasks published every December, which you solve and compete with others. Many would agree that it's the best advent calendar to celebrate Christmas and New Year! To help the community learn idiomatic Kotlin, and motivate more developers to solve Advent of Code tasks in Kotlin in the future, we decided to prepare solutions for the tasks from Advent of Code 2020. It doesn't matter if you solved it back in December, you're ready to solve it now, or you just want to check the solutions - we hope you'll find something useful in these materials. Of course, it works best if you try to solve the same task first yourself! Below is the solution and video for the first task. If you find this format useful and want us to cover more tasks in a similar fashion, please share in the comments! Day 1. Report Repair We're fixing an expense report! Find the full task description at https://adventofcode.com/2020/day/1*. You need to find the two (and in the second part, three) entries from the list of numbers that sum to 2020 and then multiply those two (or three) numbers together. How to solve the task Register at https://adventofcode.com/, open the task at https://adventofcode.com/2020/day/1, write your solution in Kotlin, and check the result on the site. You can either write Kotlin code online or using an IDE: download the free Community Edition of IntelliJ IDEA create a Kotlin project write your solution there Finally, compare your solution with the solution below. We marked the src folder as a source set to put t

## Using Advent of Code to Practice Python and Algorithm Implementation

DevFeed: [Using Advent of Code to Practice Python and Algorithm Implementation](<https://devfeed.tech/articles/the-kata-27312.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201908/the-kata/>)

Published: 2019-08-13T00:00:00Z

Content type: opinion

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [Mazes](<https://devfeed.tech/topics/maze.md>)

Tags: [adventofcode](<https://devfeed.tech/tags/adventofcode.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [puzzles](<https://devfeed.tech/tags/puzzles.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

The author describes using Advent of Code puzzles to deepen Python knowledge and practice algorithm implementation. A maze-solving problem provided practice with graph traversal, shortest-path reasoning, and measuring traveled distance.

### Source excerpt

I'm learning python for some time now. I've made myself familiar with the syntax and then started looking into other ways to increase my knowledge about language and learn its quirks. I've found a very nice site that allows me to practice basics and strengthen different kind of muscles that I'm using in my day job - adventofcode. Read more

## Python Utilities by Peter Norvig

DevFeed: [Python Utilities by Peter Norvig](<https://devfeed.tech/articles/python-utilities-by-peter-norvig-31838.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2016/12/peter-norvigs-python-utilities-advent-of-code/>)

Author: Chris Hager

Published: 2016-12-27T00:00:00Z

Content type: article

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [code](<https://devfeed.tech/tags/code.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

The article presents Python utility functions from Peter Norvig's Advent of Code work, including imports and an input-file helper, and points readers to the full post for further solutions.

### Source excerpt

Peter Norvig, the famous American computer scientist and Director of Research at Google Inc., participated in this year's Advent of Code (a series of small programming puzzles), and shared his experience in an interesting blog post. The post starts with this amazing collection of Python utility functions, which may also be useful for your next project: # Python 3.x import re import numpy as np import math import urllib.request from collections import Counter, defaultdict, namedtuple, deque from functools import lru_cache from itertools import permutations, combinations, chain, cycle, product from heapq import heappop, heappush def Input(day): "Open this day's input file.

## Advent of Code 2016

DevFeed: [Advent of Code 2016](<https://devfeed.tech/articles/advent-of-code-2016-40525.md>)

Original publisher: [Read original article](<http://nbviewer.ipython.org/url/norvig.com/ipython/Advent%20of%20Code.ipynb>)

Published: 2016-12-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Code Challenge](<https://devfeed.tech/topics/code-challenge.md>), [Jupyter Notebook](<https://devfeed.tech/topics/jupyter-notebook.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [code](<https://devfeed.tech/tags/code.md>), [jupyter-notebook](<https://devfeed.tech/tags/jupyter-notebook.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>), [solutions](<https://devfeed.tech/tags/solutions.md>), [test](<https://devfeed.tech/tags/test.md>)

### AI overview

Peter Norvig documents his solutions to the Advent of Code puzzles released from December 1 through December 25, 2016. The notebook includes preparation, utility functions, tests, and selected explanations of his solving approach.

### Source excerpt

Solutions to the puzzle site.

## Advent of Code 2017

DevFeed: [Advent of Code 2017](<https://devfeed.tech/articles/advent-of-code-2017-40596.md>)

Original publisher: [Read original article](<https://github.com/norvig/pytudes/blob/master/ipynb/Advent%202017.ipynb>)

Published: 2016-12-24T00:00:00Z

Content type: article

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Advent of Code](<https://devfeed.tech/topics/advent-of-code.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [2017](<https://devfeed.tech/tags/2017.md>), [advent-of-code](<https://devfeed.tech/tags/advent-of-code.md>), [code](<https://devfeed.tech/tags/code.md>), [puzzle](<https://devfeed.tech/tags/puzzle.md>), [solutions](<https://devfeed.tech/tags/solutions.md>)

### AI overview

A collection of solutions to the Advent of Code 2017 puzzle site.

### Source excerpt

Solutions to the puzzle site.