Problems > Count Multiples of 6 > Editorial

Count Multiples of 6 — Solution & Editorial

Back to the Problem

Prefix counts of the predicate; O(1) per query.

Complexity: O(N + Q)