2024 Day 6 Complete!

This commit is contained in:
2024-12-07 08:09:00 -06:00
parent b852b3951a
commit cf6c7f34f4
6 changed files with 495 additions and 1 deletions

View File

@@ -34,6 +34,21 @@ func NewCoordByteMap() CoordByteMap {
}
}
func (m *CoordByteMap) Copy() *CoordByteMap {
c := CoordByteMap{
Field: make(map[Coordinate]byte),
TLX: m.TLX,
TLY: m.TLY,
BRX: m.BRX,
BRY: m.BRY,
StringEmptyByte: m.StringEmptyByte,
}
for i := range m.Field {
c.Field[i] = m.Field[i]
}
return &c
}
func StringSliceToCoordByteMap(input []string) CoordByteMap {
ret := CoordByteMap{
Field: make(map[Coordinate]byte),
@@ -259,7 +274,7 @@ func (m *CoordByteMap) FindLast(b byte) (Coordinate, error) {
}
}
}
return Coordinate{}, errors.New("Not Found")
return Coordinate{}, errors.New("not found")
}
func (m *CoordByteMap) FindAll(b ...byte) []Coordinate {