leetcode-2788按分隔符拆分字符串

题目链接

2788. 按分隔符拆分字符串 - 力扣(LeetCode)

解题思路

class Solution:
    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:
        result = []
        for i in words:
            for j in i.split(separator):
                if j:
                    result.append(j)
        return result

你可能感兴趣的:(leetcode,算法,数据结构)