Company: SAP Labs
Difficulty: medium
Common Town Name The current selected programming language is C++14 . We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted , you cannot review this problem again. You can use cout to debug your code. The cout may not work in case of syntax/runtime error. The version of GCC being used is 5.5.0 . There are N people living in a state. In this state, people concatenate their town name before their first name. Write an algorithm to find the name of the town of the given N people where the name of the town is the common substring and has the maximum length. Input Format The first line of the input consists of an integer - size , representing the given number of people (N). The second line consists of N space-separated strings representing the first names of the people. Output Format Print a string in lowercase letters representing the name of the town of the given N people where the name of the town is the common substring and has the