Challenge: Longest Common Substring

Let's write some code to find the longest common substring.

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.