Advent of Code puzzles in idiomatic Kotlin
Advent of Code is an annual December event, where holiday-themed puzzles are published every day from December 1 to December 25. With the permission of Eric Wastl, creator of Advent of Code, we'll show how to solve these puzzles using the idiomatic Kotlin style.
Day 1: Report repair
Explore input handling, iterating over a list, different ways of building a map, and using the
let function to simplify your code.
Day 2: Password philosophy
Explore string utility functions, regular expressions, operations on collections, and how the
let function can be helpful to transform your expressions.
Day 3: Toboggan trajectory
Compare imperative and more functional code styles, work with pairs and the
reduce() function, edit code in the column selection mode, and fix integer overflows.
Day 4: Passport processing
when expression and explore different ways of how to validate the input: utility functions, working with ranges, checking set membership, and matching a particular regular expression.
Day 5: Binary boarding
Use the Kotlin standard library functions (
find()) to work with the binary representation of numbers, explore powerful local functions, and learn how to use the
max() function in Kotlin 1.5.
Day 6: Custom customs
Learn how to group and count characters in strings and collections using the standard library functions: