

Manipulating lists using windowed, scan, firstNotNullOfOrNull: Solving Advent of...
source link: https://www.youtube.com/watch?v=vj3J9MuF1mI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Manipulating lists using windowed, scan, firstNotNullOfOrNull: Solving Advent of Code Puzzles
In this episode of Idiomatic Kotlin’s #AdventOfCode series, we’ll look at different ways to manipulate lists in Kotlin to solve the puzzle. We’ll work with the ‘any’, ‘firstOrNull’, ‘firstNotNullOfOrNull’, ‘windowed’, ‘takeIf’, and ‘scan’ functions, which exemplify an idiomatic Kotlin style.
0:00 Intro 0:36 Puzzle Description 1:57 Solution, Part I 4:25 Finding invalid number 6:32 Using ‘windowed’ 9:08 Part II 9:52 Solution, Part II
Note about the difference between sublist and windowed functions → https://blog.jetbrains.com/kotlin/202... GitHub project → https://github.com/Kotlin-hands-on/ad... Blog post → https://blog.jetbrains.com/kotlin/202...
* Used with the permission of Advent of Code (Eric Wastl)
Idiomatic Kotlin: Solving Advent of Code Puzzles Series https://youtube.com/playlist?list=PLl...
#Kotlin #AdventOfСodeInKotlin #DAY9 #Idiomatic #Tutorial #AdventOfCode
Show lessShow more
11 Comments
Recommend
-
14
[Submitted on 19 May 2019] Windowed quantum arithmetic Craig Gidney
-
21
Abhinav's Notes Learnings from Solving Advent of Code 2020 in Haskell After many years of trying unsuccessfully, I finally completed all 25 days of t...
-
12
News Solving Advent of Code Puzzles in Idiomatic Kotlin
-
10
#Kotlin #AdventOfСodeInKotlin #DAY1Idiomatic Kotlin: Solving Advent of Code Puzzles, Day 1
-
9
#AdventOfCode #Kotlin #AdventOfС...
-
25
Solving Advent of Code Puzzles with GitHub Copilot: Day 1 Wednesday. December 01, 2021 - 8 mins WARNING: Spoilers for Advent of Code below This year, I decided to try my hand at solving
-
13
Advent of Code: Solving Your Puzzles With Python Advent of Code is an online...
-
9
Windows 11 Insiders now have optimizations for legacy games running in windowed mode If you're playing legacy games on your Windows machine, you'll be pleased to know that Microso...
-
13
The latest preview build updated with a new feature Windows 11 is an operating system that can be used for working, creating, and having fun, so it goes without saying that games continue to be...
-
15
<?xml encoding="utf-8" ??>Introduction In MySQL, a running total is a derived column that computes one or more columns' values while continuously taking care of newly inserted table records. The...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK