![]() If the first 25 numbers are 1 through 25 in a random order, the next number must be the sum of two of those numbers to be valid: ![]() Two numbers that sum to a valid number must be different from each other. We’ll call the number valid if it can be presented as a sum of two numbers from the previous sublist, and invalid otherwise. We need to attack a weakness in data encrypted with the eXchange-Masking Addition System (XMAS)! The data is a list of numbers, and we need to find the first number in the list (starting from the 26th) that is not the sum of any 2 of the 25 numbers before it. While solving it, we’ll look into different ways to manipulate lists in Kotlin. ![]() This post continues our “Idiomatic Kotlin” series and provides the solution for the Advent of Code Day 9* challenge.
0 Comments
Leave a Reply. |