给定一个字符串列表,找出所有字符串共有的最长子串。
输入格式
第一行包含一个整数 $n$ ($1 \le n \le 1,000$),表示后续字符串的数量。
接下来的 $n$ 行,每行包含一个仅由小写字母组成的字符串 $s$ ($1 \le |s| \le 100$)。
输出格式
输出一个整数,表示所有输入字符串共有的最长子串的长度。
样例
样例输入 1
5 axabcrwmvd abcn tabchwqsl bvrkabcayna tyabc
样例输出 1
3
给定一个字符串列表,找出所有字符串共有的最长子串。
第一行包含一个整数 $n$ ($1 \le n \le 1,000$),表示后续字符串的数量。
接下来的 $n$ 行,每行包含一个仅由小写字母组成的字符串 $s$ ($1 \le |s| \le 100$)。
输出一个整数,表示所有输入字符串共有的最长子串的长度。
5 axabcrwmvd abcn tabchwqsl bvrkabcayna tyabc
3
| ID | Type | Status | Title | Posted By | Last Updated | Actions |
|---|---|---|---|---|---|---|
| Editorial | Open | Official Editorial | Qingyu | - | Download |
The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.
This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.
If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.
Guidelines: