Challenge: Longest Common Substring
Let's write some code to find the longest common substring.
We'll cover the following
Problem statement
Given two strings, s1
and s2
, write a function that finds and returns the length of the longest substring of s2
in s1
(if any exists).
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.