Algorithm · Databricks · Medium
Target String Partitioned by Source Indices Problem Overview You are given a target string a and a source string b. Every character in a occurs somewhere in b. Express all of a by dividing it into consecutive pieces, where each piece must be a contiguous substring of b. Return every piece as its inclusive [start, end] index interval within b. A piece may be reused, and two pieces are allowed to refer to overlapping portions of b. The problem has two stages: Build a valid…
Checking your access…