Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT arr = [ " geeksforgeeks " , " geeks " , " geek " , " geezer " ] NEW_LINE n = len ( arr ) NEW_LINE ans = commonPrefix ( arr , n ) NEW_LINE if ( len ( ans ) ) : NEW_LINE INDENT print ( " The ▁ longest ▁ common ▁ prefix ▁ is ▁ - " , ans ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " There ▁ is ▁ no ▁ common ▁ prefix " ) NEW_LINE DEDENT DEDENT