Search
⌘K

Leetcode 1714. Sum Of Special Evenly-Spaced Elements In Array

Given an array, answer queries (and possibly point updates) that ask for the sum of elements at indices forming an arithmetic progression (a start index and fixed step k) over many operations; constraints are large so you must exploit the evenly‑spaced pattern (e.g., group indices by modulo k, precompute for small k, or use sqrt‑decomposition / indexed structures) to achieve sublinear per‑query time.


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.