我假设我在这里描述的内容有一个名称。
基本上,如果我搜索“word1 word2 word3”(不带引号)并且我有这个数组:
["word1 word2",
"word1 word2 word3",
"word3 word2 word1",
"word2 word3 word1",
"word1 word3 word2 word4",
"word1 word4 word3",
"word4 word1 word2 word3"]
它应该返回这些找到的结果:
word1 word2 word3
word3 word2 word1
word2 word3 word1
word1 word3 word2 word4
word4 word1 word2 word3
这种算法有什么名字吗?