2023 Day 5 Complete!

This commit is contained in:
2023-12-05 11:23:48 -06:00
parent 38a74e36d9
commit 1c5f960426
5 changed files with 636 additions and 0 deletions

View File

@@ -389,6 +389,18 @@ func IsPrime(value int) bool {
return value > 1
}
func SliceMin(sl []int) int {
switch len(sl) {
case 0:
return MIN_INT
case 1:
return sl[0]
case 2:
return Min(sl[0], sl[1])
default:
return Min(sl[0], sl[1], sl[2:]...)
}
}
func Min(v1, v2 int, vrest ...int) int {
min := v2
if v1 < v2 {