Challenge: Longest Common Substring
Solve the longest common substring problem.
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 70+ hands-on prep courses.