https://leetcode.com/problems/palindrome-partitioning/



Runtime: 1320 ms, faster than 13.39% of Python3 online submissions for Palindrome Partitioning.

Memory Usage: 30.3 MB, less than 43.41% of Python3 online submissions for Palindrome Partitioning.



```python
class Solution:
    def partition(self, s: str) -> List[List[str]]:
        #8:54
        def is_palindrome(string_: str):
            length = len(string_)
            if length == 1:
                return True
            else:
                center_index = length // 2
                if length % 2 == 1:
                    part1 = string_[:center_index+1]
                elif length % 2 == 0:
                    part1 = string_[:center_index]
                part2 = "".join(list(reversed(string_[center_index:])))
                #print(part1, part2)
                if part1 == part2:
                    return True
                else:
                    return False
        
        result_list = []
        
        def go_though(index, current_list):
            if index > len(s) - 1:
                #print(index)
                result_list.append(current_list.copy())
                return
            
            progress = 1
            while (index+progress) <= len(s):
                part = s[index:index+progress]
                #print(part)
                if (is_palindrome(part)):
                    go_though(index+progress, current_list+[part])
                progress += 1
        
        go_though(0, [])
        
        return result_list
        #9:07
        #debug until 9:16
```


___


It's not your fault, 99% of those people are losing their money.

Control the damage.
