DiffPush Tier Recursion · Try Out All Combos O(n * 2^n) — up to 2^n cut plans, each checked and copied in O(n) · O(n) recursion depth beyond the output
A telecom archive stores telemetry strings that auditors want pre-sliced into blocks, where every block reads the same forwards and backwards. The slicer scans from the current offset, cuts at every prefix that survives the mirror test, and recurses on the remainder — recording a full slicing plan each time the string is consumed.
Input: A string s of lowercase letters.
Output: Every partition of s into palindromic substrings, each as a list of the pieces in order.
1 <= s.length <= 16s consists of lowercase English lettersInput: {"s":"aab"}
Output: [["a","a","b"],["aa","b"]]
Single-letter cuts always mirror; the only multi-letter option is slicing off "aa" first.
Input: {"s":"a"}
Output: [["a"]]
One character is its own mirror image.