Reported interview periodMay 2026
Partition a Target into Source Substrings
Given a source string and a target string, represent the target as the fewest contiguous substrings copied from the source. Return the inclusive source range used for each target piece, in target order.
Practice focusAssumptions Ranges are zero-based and inclusive. If the target cannot be covered, return [] ; an empty target also returns [] . Among solutions with the fewest pieces, prefer the longest possible next piece, then the leftmost matching source range. For example, min partitions("abcdbcd", "dabcd") returns [[3,3], [0,3]] . min partitions after delete removes target[index] and solves the same problem; the index must be an integer (not a boolean) from zero through len(target)-1 . Invalid indices raise IndexError .…