Number of Beautiful Partitions
Count ways to split the digits into k pieces, tracking valid cut points in a table over end position and piece count.
Count ways to split the digits into k pieces, tracking valid cut points in a table over end position and piece count.