dsa1 min read
Shifting Letters II — Difference Array
Apply range shift operations to letters. Difference array: mark +1 at start and -1 at end+1, prefix sum gives net shift at each position.
Read →
1 articles
Apply range shift operations to letters. Difference array: mark +1 at start and -1 at end+1, prefix sum gives net shift at each position.