Longest common prefix: Difference between revisions

m
→‎{{header|Go}}: add lcp(a, "", b) where lcp(a,b) != "" example
(Change the lcp(a, "", b) case to have lcp(a, b) != ""; otherwise it's not testing what is desired)
m (→‎{{header|Go}}: add lcp(a, "", b) where lcp(a,b) != "" example)
Line 66:
{"throne", "throne"},
{"throne", "dungeon"},
{"throne", "", "throne"},
{"cheese"},
{""},
Line 80 ⟶ 81:
lcp(["throne" "throne"]) = "throne"
lcp(["throne" "dungeon"]) = ""
lcp(["throne" "" "throne"]) = ""
lcp(["cheese"]) = "cheese"
lcp([""]) = ""
Anonymous user