In the event of technical difficulties with Szkopuł, please contact us via email at firstname.lastname@example.org.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
A sequence of words over alphabet is given. The length of longest word occuring as a coherent fragment in every word given is to be found.
Write a program which:
In the first line of the standard input there is an integer , where is the number of words. In each of the next lines there is one word formed from small letters of English alphabet . The length of each word is at least , but not greater than .
The text of standard output should consist of exactly one line containing a single integer equal to the length of the longest word occuring as the coherent fragment in every word given.
For the input data:
3 abcb bca acbc
the correct result is:
Task author: Adam Malinowski.