| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 9013 | Longest Common Substring |
|
| 9192 | Find the Longest Palindrome |
|
Description
Given two strings, find the length of the longest common substring.
Input
The first line of input contains a positive integer t (t <= 100), which indicates the number of test cases. For each case, there are two strings in a line (length of the string < 1000).
Output
Output the length of the longest common substring.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Palindrome is a string that is identical to its reverse, like "level" or "aba". Given a string, find the longest palindrome in the string.
Input
The input consists of multiple lines. Each line contains a string. The length of each string is less than 1000.
Output
In each test case, output the longest palindrome in the string. If there are many palindromes of the same length, output the first one in the string.