Class SolutionDay13

java.lang.Object
com.expedient.adventofcodejade.BaseSolution
com.expedient.adventofcodejade.solutions.year2024.SolutionDay13

public class SolutionDay13 extends BaseSolution
  • Constructor Details

  • Method Details

    • getMachines

      public List<SolutionDay13.Machine> getMachines(PuzzleInput input, boolean partTwo)
      Parse the PuzzleInput into a list of Machines
      Parameters:
      input - the PuzzleInput
      partTwo - whether this is part two, where a huge constant is added to the prize coords
      Returns:
      A List of Machines defined by the input
    • solveMachines

      public long solveMachines(List<SolutionDay13.Machine> machines)
      Given a list of Machines, calculates the solution for each Machine using Cramer's rule, then discard every machine whose solution doesn't actually work.
      Parameters:
      machines - List of Machines
      Returns:
      the total tokens required to win all machines
    • partOne

      public Long partOne(PuzzleInput input)
      Description copied from class: BaseSolution
      Logic for part one of the solution. Must be overridden when implementing the solution.
      Specified by:
      partOne in class BaseSolution
      Parameters:
      input - the PuzzleInput to be used for the solution
      Returns:
      output of this part of the solution
    • partTwo

      public Long partTwo(PuzzleInput input)
      Description copied from class: BaseSolution
      Logic for part two of the solution. Must be overridden when implementing the solution.
      Specified by:
      partTwo in class BaseSolution
      Parameters:
      input - the PuzzleInput to be used for the solution
      Returns:
      output of this part of the solution