Explain and solve below q on cpp(soln must!)

Ms. Reema gave some students a puzzle to solve. The students copied few characters fromthe beginning of the answer from each other. Ms. Reema needs to find the copied characters that all students have copied. In case nobody cheated, output an empty string.
Input Format

First line contains N,size of array. Next N lines contains a string in each line.
Constraints

0<=n<=1000

Length of string<=1e5
Output Format

A single String

Sample Input

4

abad abcd abapp abadcd

Sample Output

ab

Explanation

All the strings start with characters as “ab”.

Hey @Kash-Moulik-3715574511847721 what haven’t you understand in this problem statement?

like i can code for similar char in the given string but it is not the case so how can we solve this type?

i have coded it here


You can have a look and also have added few comments for better understanding.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.