Driver Code
int main ( ) { string ar [ ] = { " geeksforgeeks " , " geeks " , " geek " , " geezer " } ; int n = sizeof ( ar ) / sizeof ( ar [ 0 ] ) ; cout << " The ▁ longest ▁ common ▁ prefix ▁ is : ▁ " << longestCommonPrefix ( ar , n ) ; return 0 ; }