Unimodal Subsets
CodeChefOpen on judge ↗
You are given a multiset $A$ containing $N$ integers. Your task is to count the number of distinct subsets of the multiset $A$, that have a [unique mode](https://mathworld.wolfram.com/Mode.html). Since this number can be huge, print it modulo $1000000007$. Note that if two subsets form the same set of values, they are **not** counted as different subsets. For example, consider $A = [1, 1, 2, 1]
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start