Daily challenge for 2026-08-07
584. Assemble Broken Document Fragments
You are given an array of strings fragments and a string delimiter. Each fragment starts with an integer index followed by a hyphen - and then the text content (for example, "10-content").
Reassemble the document by sorting the fragments based on their integer index in ascending order, extracting only the text content, and joining them using the provided delimiter.
Example:
Input: fragments = ["2-world", "1-hello", "3-fun"], delimiter = " "
Output: "hello world fun"
Run this challenge interactively in Python or JavaScript when the app loads.