Driver Code
arr = [ " geeksforgeeks " , " geeks " , " geek " , " geezer " ] NEW_LINE lcp = CommonPrefix ( arr ) NEW_LINE if len ( lcp ) > 0 : NEW_LINE INDENT print ( " The ▁ longest ▁ common ▁ prefix ▁ is ▁ " + str ( lcp ) ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " There ▁ is ▁ no ▁ common ▁ prefix " ) NEW_LINE DEDENT