Given two strings ‘X’ and ‘Y’, find the length of the longest common substring.

preview_player
Показать описание
Given two strings ‘X’ and ‘Y’, find the length of the longest common substring.


Input : X = "abcdxyz", y = "xyzabcd"

Output : 4

The longest common substring is "abcd" and is oflength 4.

Input : X = "zxabcdezy", y = "yzabcdezx"
Рекомендации по теме