Imports #
"bufio"
"fmt"
"io"
"log"
"strconv"
"advent2024/pkg/solver"
"advent2024/pkg/solver"
"context"
"fmt"
"io"
"strconv"
"bufio"
"fmt"
"io"
"log"
"strconv"
"advent2024/pkg/solver"
"advent2024/pkg/solver"
"context"
"fmt"
"io"
"strconv"
Solver name
var day = "d0"
PuzzleStruct
type PuzzleStruct struct {
input string
}
PuzzleStruct with Context
type PuzzleStructWithCtx struct {
PuzzleStruct
}
Initializes the PuzzleStruct with input Return nil on success
func (p *PuzzleStruct) Init(reader io.Reader) error
Initializes the PuzzleStruct with input
func (p *PuzzleStructWithCtx) InitCtx(ctx context.Context, reader io.Reader) error
Constructor
func NewSolver() *PuzzleStruct
Constructor
func NewSolverWithCtx() *PuzzleStructWithCtx
Solves the puzzle Accepts part as parameter Returns string containing the solution of the puzzle
func (p *PuzzleStruct) Solve(part int) (string, error)
Solves the puzzle Accepts part as parameter Returns string containing the solution of the puzzle
func (p *PuzzleStructWithCtx) SolveCtx(ctx context.Context, part int) (string, error)
Registers day wih the registry
func init()
Registers day wih the registry
func init()
Parses provided input Returns parsed string
func parseInput(sc *bufio.Scanner) (string, error)
Validates parsed input Returns nil in case of successfull validation
func validateInput(entry string) error