Back to problems

Segment Sequence Reconstruction

Algorithm · Microsoft AI · Medium

Problem A data pipeline processes a long string that has been broken into ordered fragments. You receive a list segments, where each entry is a triplet of strings: [startId, endId, payload]. The startId and endId are identifiers marking the segment's endpoints, and payload is the actual string fragment stored in that segment. The segments collectively form a single directed chain: the endId of one segment matches the startId of the segment that immediately follows it. Every…

Checking your access…