refactor: standardize PartOne/PartTwo declarations

This commit is contained in:
2025-11-28 09:01:11 +01:00
parent 62969312e3
commit 3fb71d0cbf
4 changed files with 22 additions and 24 deletions

View File

@@ -17,10 +17,10 @@ func ParseInput(filepath string) []string {
return strings.Split(string(content), "\n")
}
func PartOne(input []string) int {
func PartOne(data []string) int {
maxCalories, currentElf := 0, 0
for _, line := range input {
for _, line := range data {
if line == "" {
maxCalories = max(maxCalories, currentElf)
currentElf = 0
@@ -33,11 +33,11 @@ func PartOne(input []string) int {
return max(maxCalories, currentElf)
}
func PartTwo(input []string) int {
func PartTwo(data []string) int {
var totals []int
currentElf := 0
for _, line := range input {
for _, line := range data {
if line == "" {
totals = append(totals, currentElf)
currentElf = 0