Two strings str1 and str2, find longest common substring
A new method:
Build the hash table based on all substring from str1. O(n^2)
For each substring from str2, lookup the hash table and keep the max length of substring. O(n^2)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment