filmov
tv
Longest Substring of Two String with Python

Показать описание
Question:
Find the longest common substring of two strings.
Approach:
Find the length of the smaller string, and iterate through both strings comparing elements, if the elements are similar append to the substring array. Else return the substring array
Time complexity: O(n)
Space complexity: O(n)
#softwareengineer #interviewpreparation #dsa
Find the longest common substring of two strings.
Approach:
Find the length of the smaller string, and iterate through both strings comparing elements, if the elements are similar append to the substring array. Else return the substring array
Time complexity: O(n)
Space complexity: O(n)
#softwareengineer #interviewpreparation #dsa