Check whether a string slice contains a certain value in Go
If you have a slice of strings in an arbitrary order, finding if a value exists in the slice requires O(n) time. This applies to all languages. If you intend to do a search over and over again, you can use other data structures to make lookups faster. However, building these structures require at least … Read more