The Elves have good news and bad news.
The good news is that they've discovered project management! This has given them the tools they need to prevent their usual Christmas emergency. For example, they now know that the North Pole decorations need to be finished soon so that other critical tasks can start on time.
Visit the website for the full story and full puzzle description.
Let’s see what this shortened season brings. On the C# side, I keep using a functional style with perhaps a bit too much LINQ and unortodox solutions. But prioritize readability over performance as usual.
I’ll try using Bing and Nano Banana for the illustrations this year, along with an elf figure selected from last year. We’ll see how it goes.
namespace AdventOfCode.Y2025.Day01;
using System;
using System.Collections.Generic;
using System.Linq;
[ProblemName("Secret Entrance")]
class Solution : Solver {
public object PartOne(string input) => Dial(Parse1(input)).Count(x => x == 0);
public object PartTwo(string input) => Dial(Parse2(input)).Count(x => x == 0);
IEnumerable<int> Dial(IEnumerable<int> rotations) {
int pos = 50;
foreach (var rotation in rotations) {
pos = (pos + rotation) % 100;
yield return pos;
}
}
IEnumerable<int> Parse1(string input) =>
from line in input.Split("\n")
let d = line[0] == 'R' ? 1 : -1
let a = int.Parse(line.Substring(1))
select a * d;
IEnumerable<int> Parse2(string input) =>
from line in input.Split("\n")
let d = line[0] == 'R' ? 1 : -1
let a = int.Parse(line.Substring(1))
from i in Enumerable.Range(0, a)
select d;
}
Please ☆ my repo if you like it!