def wordBreak(self, s, dict):
        # dp = [[]] * (len(s) + 1) # namespace reuse
        dp = [[] for _ in range(len(s)+1)]

        dp[0].append("dummy")

        for i in range(len(s)):
            if not dp[i]:
                continue
            for word in dict:
                if s[i: i+len(word)]==word:
                    dp[i+len(word)].append(word)

        # build result
        if not dp[-1]:
            return []

        result = []
        cur_sentence = []
        self.__build_result(dp, len(s), cur_sentence, result)
        return result
test catalog show command
dataset/ETHPy150Open algorhythms/LeetCode/140 Word Break II.py/Solution.wordBreak--crossover with--dataset/ETHPy150Open dtroyer/python-openstackclient/functional/tests/identity/v3/test_catalog.py/CatalogTests.test_catalog_show