Page tree
Skip to end of metadata
Go to start of metadata
    def partition(self, s: str) -> List[List[str]]:

        from collections import defaultdict

        graph = defaultdict(list)

        def store_character(i, c):
            graph[i] += c
            i -= 1
            if i >= 0:
                store_character(i, c)
            else:
                return

        def split_palindrome(i):
            pass
            

        for i, c in enumerate(s):
            store_character(i, c)
            split = split_palindrome(i)
            self.partition(split)
  • No labels