def wordBreak(self, s, dict):
        n = len(s)
        possible = [False for _ in xrange(n)]
        valid = [[False] * n for _ in xrange(n)]
        for i in xrange(n):
            if dict in s[:i+1]:
                possible[i] = True
                valid[0][i] = True
            for j in xrange(i):
                if possible[j] and s[j+1:i+1] in dict:
                    valid[j+1][i] = True
                    possible[i] = True
        result = []
        if possible[n-1]:
            self.genPath(s, valid, 0, [], result)
        return result
dataset/ETHPy150Open kamyu104/LeetCode/Python/word-break-ii.py/Solution.wordBreak/swapped operands of `in`