aoc2024/day-24/internal/one/zwire.go

21 lines
277 B
Go
Raw Normal View History

2024-12-25 14:46:40 +00:00
package one
const noValue = -1
type byName []zWire
func (b byName) Len() int {
return len(b)
}
func (b byName) Less(i, j int) bool {
2024-12-26 13:27:58 +00:00
return b[j].name > b[i].name
}
func (b byName) Swap(i, j int) {
b[i], b[j] = b[j], b[i]
}
2024-12-25 14:46:40 +00:00
type zWire struct {
name string
value int
}