day4

package
v0.0.0-...-26478da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 5 Imported by: 0

README

2023 Day 4

Learnings

  1. Puzzle 1 was straightforward, can be solved easily with Regexp.
  2. Puzzle 2 was good practice for writing recursive functions.
  3. Processing time could have been shortened with go routines.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Id             int
	Input          string
	WinningNumbers []int
	CardNumbers    []int
}

func NewCard

func NewCard(input string) *Card

func (*Card) Calculate

func (c *Card) Calculate() (int, error)

func (*Card) NumberOfCardsWon

func (c *Card) NumberOfCardsWon() (int, error)

type CardPile

type CardPile struct {
	Cards []*Card
	// contains filtered or unexported fields
}

func NewCardPile

func NewCardPile(input []string) *CardPile

func (*CardPile) TotalWinningCards

func (p *CardPile) TotalWinningCards() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL