Day 6 solution

I'm reasonably happy with this. I started with a bi-directional linked list, but realized that a flat list of all nodes came in handy for one use case while the linked list came in handy for another, so I settled on that.
This commit is contained in:
2022-06-09 13:24:12 -05:00
parent 52737dd7c3
commit 9a4fb7c734
6 changed files with 1164 additions and 0 deletions

12
utilities/array.go Normal file
View File

@ -0,0 +1,12 @@
package utilities
// ArrayContains returns whether the specified array contains the specified value
func ArrayContains[T comparable](array []T, val T) bool {
for _, v := range array {
if v == val {
return true
}
}
return false
}