Implement:
partitions(s): all ways to split s into substrings that are each palindromes, in the order produced by trying shorter first pieces firstmin_cuts(s): the minimum number of cuts so every piece is a palindrome, in O(n²) using a precomputed palindrome table and a 1-D DPUnlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial