Skip to content

Commit 3ff3d10

Browse files
Create LongestCommonSubstring.txt
1 parent a79eacf commit 3ff3d10

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Longest Common Substring | DP-29
2+
3+
Given two strings ‘X’ and ‘Y’, find the length of the longest common substring.
4+
5+
Examples :
6+
7+
Input : X = “abcdxyz”, y = “xyzabcd”
8+
Output : 4
9+
The longest common substring is “abcd” and is of length 4.
10+
11+
Input : X = “zxabcdezy”, y = “yzabcdezx”
12+
Output : 6
13+
The longest common substring is “abcdez” and is of length 6.

0 commit comments

Comments
 (0)