LIKE CODING: MJ [44] Find the Longest Substring
MJ [44] Find the Longest Substring
Question:
Give a dictionary "dict" and a string "S", find the longest valid word in dict which is a substring of "S".
Eg. dict = {"abc", "defgh", "ef"}
S = "adbecfgh".
It should return "defgh".
Give a dictionary "dict" and a string "S", find the longest valid word in dict which is a substring of "S".
Eg. dict = {"abc", "defgh", "ef"}
S = "adbecfgh".
It should return "defgh".
Read full article from LIKE CODING: MJ [44] Find the Longest Substring
No comments:
Post a Comment