Problem 1622 · Hard

Fancy Sequence

Store values with a lazy global multiplier and offset so addAll and multAll run in O(1) and getIndex applies the inverse transform.

Open the interactive visualisation