Class SolutionDay5
java.lang.Object
com.expedient.adventofcodejade.BaseSolution
com.expedient.adventofcodejade.solutions.year2024.SolutionDay5
-
Constructor Summary
ConstructorsConstructorDescriptionSolutionDay5(PuzzleInput input, PuzzleInput sampleInputOne, PuzzleInput sampleInputTwo) -
Method Summary
Modifier and TypeMethodDescriptionpartOne(PuzzleInput input) Gets all the sorted updates, and then provides the sum of all middle numbers from each good update listpartTwo(PuzzleInput input) Finds all update lists that are not already sorted, then sorts them and sums up the middle number from each one.Methods inherited from class com.expedient.adventofcodejade.BaseSolution
getInput, run
-
Constructor Details
-
SolutionDay5
-
-
Method Details
-
partOne
Gets all the sorted updates, and then provides the sum of all middle numbers from each good update list- Specified by:
partOnein classBaseSolution- Parameters:
input- the PuzzleInput to be used for the solution- Returns:
- the sum of middle numbers from the good updates
-
partTwo
Finds all update lists that are not already sorted, then sorts them and sums up the middle number from each one.- Specified by:
partTwoin classBaseSolution- Parameters:
input- the PuzzleInput to be used for the solution- Returns:
- the sum of all middle numbers from the sorted versions of each update list
-