Tap here to switch tabs
Problem
Submissions

Problem: Minimum Non-Zero Product of the Array Elements

med
30 min
Try to solve the Minimum Non-Zero Product of the Array Elements problem.

Statement

You are given a positive integer p. Consider an array nums containing all integers in the inclusive range [1,2p−1][1, 2^p - 1] represented in binary form.

In one operation, you may choose two elements from nums and swap their bits at any corresponding bit position.

Return the minimum non zero product of all elements in nums after applying any number of operations. Since the result can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq p ≤60\leq 60

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Non-Zero Product of the Array Elements

med
30 min
Try to solve the Minimum Non-Zero Product of the Array Elements problem.

Statement

You are given a positive integer p. Consider an array nums containing all integers in the inclusive range [1,2p−1][1, 2^p - 1] represented in binary form.

In one operation, you may choose two elements from nums and swap their bits at any corresponding bit position.

Return the minimum non zero product of all elements in nums after applying any number of operations. Since the result can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq p ≤60\leq 60