Problem 1969 · Medium

Minimum Non-Zero Product of the Array Elements

Maximize the product of the values after allowed bit swaps between paired numbers, then return it modulo a prime. The visual pairs the smallest and largest values and shows how each swap changes them.

Open the interactive visualisation