The most noticeable for me are privacy /ˈpɹɪv.ə.si/ and urinal /juːˈɹaɪnəl/. I can't say I feel any of them are right or wrong, though, it's just a bit of colour in the language.
hades
I haven't played a lot of them, but my favorite is Bridge Commander. I think it was super janky, but also very immersive, had actual voice lines by Brent Spiner and Patrick Stewart, and decent plot.
any chance it's overheating? did you clean the vents and checked the fans?
That just makes sense -- the top-1k are competitive programmers, and today's puzzle had nothing to do with competitive programming :)
Feels like a really bad way to get the solution, though.
Does that come from an expectation that AoC is a programming challenge, where you typically are expected to come up with an implementation that works for all possible inputs? Because AoC is intentionally not that. Some tasks in AoC can/should be solved by hand, and I don't think you should feel bad about it :)
In my input (and I suppose in everyone else's too) the swaps only occurred within the adder subcircuit for a single bit. In general, however, the way the problem is phrased, any two outputs can be swapped, which can lead to two broken bits per swap (but this just doesn't happen).
Good, although it took some time. Actually, I got my personal best global rank on that problem.
good start to your new collection of abstract art
Could you fix the year in the title? Will get confusing in four years :)
C#
public class Day19 : Solver {
private string[] designs;
private class Node {
public Dictionary<char, Node> Children = [];
public bool Terminal = false;
}
private Node root;
public void Presolve(string input) {
List<string> lines = [.. input.Trim().Split("\n")];
designs = lines[2..].ToArray();
root = new();
foreach (var pattern in lines[0].Split(", ")) {
Node cur = root;
foreach (char ch in pattern) {
cur.Children.TryAdd(ch, new());
cur = cur.Children[ch];
}
cur.Terminal = true;
}
}
private long CountMatches(Node cur, Node root, string d) {
if (d.Length == 0) return cur.Terminal ? 1 : 0;
if (!cur.Children.TryGetValue(d[0], out var child)) return 0;
return CountMatches(child, root, d[1..]) + (child.Terminal ? CountMatches(root, d[1..]) : 0);
}
private readonly Dictionary<string, long> cache = [];
private long CountMatches(Node root, string d) {
if (cache.TryGetValue(d, out var cached_match)) return cached_match;
long match = CountMatches(root, root, d);
cache[d] = match;
return match;
}
public string SolveFirst() => designs.Where(d => CountMatches(root, d) > 0).Count().ToString();
public string SolveSecond() => designs.Select(d => CountMatches(root, d)).Sum().ToString();
}
- A* algorithm
- honestly a lot of other graph algorithms, just be aware of them, and be able to find algorithms you didn't know before
- OEIS
- SMT solvers
- set operations on intervals
Bless the Maker and His water, bless the coming and going of Him.