Class SolutionDay4

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

public class SolutionDay4 extends BaseSolution
  • Constructor Details

  • Method Details

    • partOne

      public Integer partOne(PuzzleInput input)
      Find all 'X' Characters in the input grid, then find surrounding 'M' Characters for each one. After this, continue in the same direction as the 'M' to look for 'A' and then 'S'. Count each full occurrence.
      Specified by:
      partOne in class BaseSolution
      Parameters:
      input - the PuzzleInput to be used for the solution
      Returns:
      the number of times that XMAS was found in the input
    • partTwo

      public Integer partTwo(PuzzleInput input)
      Find each 'A' Character in the input grid. For each one, find non-orthogonal neighbors that are 'M' characters. Then, for each 'M' neighbor, check for 'S' in the opposite direction. If there are two 'MAS' sequences, add to the count.
      Specified by:
      partTwo in class BaseSolution
      Parameters:
      input - the PuzzleInput to be used for the solution
      Returns:
      the number of times X-MASes were found in the input