[Toggle Comments]
package main import ( "fmt" ) func main() { vals := []string{"potato", "pot", "potat", "pooh"} fmt.Println("horizontal scan ", lcpHorizontalScan(vals)) fmt.Println("vertical scan ", lcpVerticalScan(vals)) fmt.Println("divide and conquer", lcpDivideAndConquer(vals)) fmt.Println("binary search ", lcpBinarySearch(vals)) fmt.Println("use a trie ", lcpTrie(vals)) } /* * \ * \\, * \\\,^,.,,. Zero to Hero * ,;7~((\))`;;,, <zerotohero.dev> * ,(@') ;)`))\;;', stay up to date, be curious: learn * ) . ),(( ))\;, * /;`,,/7),)) )) )\,, * (& )` (,((,((;( ))\, */