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

102/257

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support