No description
Find a file
Matej Focko 9d71b4e32d
day(24): refine further
* Improve tests
  * Instead of trying to solve against a single target, the challenge
    input, go with a set of tests
  * Introduce a function that can verify the correctness of setting i-th
    bit of the output
  * Introduce a function that can generate N random tests to prune the
    search space when checking the remaining random combinations
  * Group the tests based on the inclusion of already swapped gates

* Handle loops during evaluation of the circuit correctly

* Adjust solver to be able to consume pre-set input wires

* Matchings
  * Consume the helper predicate (also fixes a possible bug)

* Part 2
  * Bail out on the first set of swaps that passes tests
  * Fix an issue with generating random candidates, for the last swap,
    that can cause some pairs of gates to disappear (if you count on the
    list of available gates for swapping to be sorted and generate pairs,
    you need to have both sequences sorted, grrr)
  * Adjust iteration through candidates to exit on the first feasible
    solution
  * When exploring swaps that are constrained by the matching verify the
    correctness of a candidate before searching that subspace

Signed-off-by: Matej Focko <me@mfocko.xyz>
2026-01-06 18:18:24 +01:00
.idea chore: format and lint all files 2024-12-02 14:24:52 +01:00
gradle/wrapper chore: initial commit 2024-12-01 13:13:49 +01:00
inputs day(25): solve 2026-01-06 09:05:32 +01:00
src day(24): refine further 2026-01-06 18:18:24 +01:00
.cz.toml ci(cz): allow docs as the type of change 2024-12-02 15:55:15 +01:00
.gitignore chore(git): correctly exclude challenge inputs 2024-12-01 13:39:25 +01:00
.pre-commit-config.yaml chore(pre-commit): autoupdate 2024-12-02 16:06:24 +01:00
build.gradle.kts chore: initial commit 2024-12-01 13:13:49 +01:00
gradlew chore: initial commit 2024-12-01 13:13:49 +01:00
gradlew.bat chore: initial commit 2024-12-01 13:13:49 +01:00
README.md chore: template cleanup 2024-12-01 13:14:07 +01:00
settings.gradle.kts chore: template cleanup 2024-12-01 13:14:07 +01:00

advent-of-code-2024

Welcome to the Advent of Code1 Kotlin project created by mfocko using the Advent of Code Kotlin Template delivered by JetBrains.

In this repository, mfocko is about to provide solutions for the puzzles using Kotlin language.

If you're stuck with Kotlin-specific questions or anything related to this template, check out the following resources:


  1. Advent of Code An annual event of Christmas-oriented programming challenges started December 2015. Every year since then, beginning on the first day of December, a programming puzzle is published every day for twenty-five days. You can solve the puzzle and provide an answer using the language of your choice. ↩︎