Search
⌘K

Leetcode 1622. Fancy Sequence

Support append, addAll, multAll, and getIndex on a sequence under up to 1e5 operations, where addAll/multAll affect all existing elements and results are modulo 1e9+7. The core challenge is to maintain and compose global affine transformations (value = a*orig + b mod MOD) and use per-element snapshots (with modular inverses) to answer point queries efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.