DCP-29: Common String Back to All Problems

Beginner Beginners Problems > Ad-hoc

In this problem you have to find the largest common string from two given string. Common substring in two strings is the common part that is present in both of them. But in a pair of string there can be many such parts. But you need to find the largest such common part and need to print the size of this part. abbaaa bbaaab In the above two strings, there are several common parts, but the largest part is bbaaa. So the output of these two will be 5. For this problem we will consider input will only have lower case English letters and there will be no space in the strings themselves. But the two strings will be separated by a single space. Input: ------ First line of the input will consist of an integer which represent the test case **T (0 < T <= 30)**. Each test case contains 2 strings separated by a space. You can assume both of these strings will be less than or equal to 100 character in length and they will only contain English lower case letters. Output: ------- For each test case first print the test case number as “**Case X: Y**” where **X** is the test case number and **Y** is an integer denoting the length of the maximum common sub-string. Sample Input ------------ 3 aaaaaa aba mizan ia tomy my Sample Output ------------- Case 1: 1 Case 2: 1 Case 3: 2

Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats




# User Language Timing
01 joy25896 Cpp14 0.00s
02 rifat_cse Cpp14 0.00s
03 maxhasan Cpp14 0.00s
04 gazi93 Cpp14 0.00s
05 badhansen123 Cpp14 0.00s
06 terminator_c Cpp14 0.00s
07 SakibAlamin Cpp14 0.00s
08 Ashish972 Cpp14 0.00s
09 gulzar Cpp14 0.00s
10 seyedssz Cpp14 0.00s
11 Nazmul0092 Cpp14 0.00s
12 emrul Cpp14 0.00s
13 mahbub07 Cpp14 0.00s
14 Dinar Cpp14 0.00s
15 AlaminJust Cpp14 0.00s
16 Saimum_140128 Cpp14 0.00s
17 smriad Cpp14 0.00s
18 afzalul Cpp14 0.00s
19 lolcoder Cpp14 0.00s
20 tasnuva1604087 Cpp14 0.00s
21 mrinmoi Cpp14 0.00s
22 _dipu Cpp14 0.00s
23 t0whid Cpp14 0.00s
24 sadia2427 Cpp14 0.00s
25 joymollick Cpp 0.00s
26 asif04 Cpp 0.00s
27 subhashis_cse Cpp 0.00s
28 Morass Cpp14 0.00s
29 pusku Cpp 0.00s
30 twyu0721 C 0.00s
31 Dalu Cpp 0.00s
32 mahmud2690 Cpp14 0.00s
33 abdulmukit Cpp 0.00s
34 wayne6172 C 0.00s
35 Riaz_BSMRSTU Cpp 0.00s
36 pulak_ict_mbstu Cpp14 0.00s
37 CSE1604084_Mahir Cpp14 0.00s
38 souravahmed C 0.00s
39 tanjilaorpe C 0.00s
40 Robbinb1993 Cpp 0.00s
41 1604099_ishtiaq Cpp 0.00s
42 Sohelr360 Cpp 0.00s
43 sajib_kumar_biswas C 0.00s
44 milon019 Cpp 0.00s
45 muntasir10mu Cpp 0.00s
46 rabbicse Cpp 0.00s
47 SaqifHaque Cpp 0.00s
48 abid5533 Cpp 0.00s
49 nayeemdev Cpp 0.01s
50 hasan_Abdullah Cpp 0.01s

Your feedback is our precious!

Or call +88 02 9853138 for support