Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The <code>powers</code> array can be created using the binary representation of <code>n</code>.
Once <code>powers</code> is formed, the products can be taken using brute force.