Scalable solution to check if string a a substring of large number of strings

前端 未结 0 1254
清歌不尽
清歌不尽 2020-12-02 15:07

How can I efficiently check if a string is a substring of any a given strings?

The naive way would be:

def is_substring_of_any(phrase, known_phrases):
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题