package main
import (
"fmt"
"time"
)
func findNemo[T comparable](a []T, ele T) {
start := time.Now()
operation := 0
for _, e := range a {
operation += 1
if e == ele {
}
}
elapsed := time.Since(start)
fmt.Println("Elapsed time: ", elapsed)
fmt.Println("Operations: ", operation)
}
func fillArray[T any](val T, size int) []T {
result := make([]T, size)
for i := range result {
result[i] = val
}
return result
}
func main() {
// findNemo([]int{1,2,3}, 2)
// findNemo([]string{"hello", "world", "there", "nemo"}, "nemo")
sample := fillArray("nemo", 100000)
findNemo(sample, "nemo")
}