1408. 数组中的字符串匹配
发布日期:2021-05-06 11:07:40 浏览次数:23 分类:精选文章

本文共 313 字,大约阅读时间需要 1 分钟。

在这里插入图片描述

class Solution:    def stringMatching(self, words: List[str]) -> List[str]:        res = set()        words.sort(key=lambda x:len(x))        for i in range(len(words)):            for j in range(i+1, len(words)):                if words[i] in words[j]:                    res.add(words[i])        return list(res)
上一篇:40. 组合总和 II
下一篇:打家劫舍

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2025年04月05日 20时46分20秒