Problem 3539 · Hard

Find Sum of Array Product of Magical Sequences

A sequence of m indices into nums is magical when the sum of 2 raised to each index has exactly k set bits. Add up the product of nums over the chosen indices for every magical sequence, modulo 1,000,000,007.

Open the interactive visualisation