Design a segment tree supporting range sum queries on [l, r] alongside range updates that add an increasing arithmetic sequence x, x+1, ..., x+r-l to elements in [l, r].
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.