Split / Merge Styled Text Ranges

Problem

Given text with styled ranges (e.g., bold from 2-5), implement applying a new style over a range, splitting/merging adjacent ranges as needed.

Example

apply bold to [3,7] -> merge/split existing style runs

Constraints

  • Ranges must stay non-overlapping and minimal

What to look for

Careful interval splitting/merging; keep runs canonical.

asked …
LeaderboardSalaryAccount