← All problemsSign in

I - Majority Partition

An integer $X$ is the **majority** of sequence $B$ if it occurs **strictly more** than $\frac{|B|}{2}$ times, where $|B|$ represents the length of $B$. A sequence $B$ is considered *awesome* if it contains an element $X$ which is a **majority**. You are given a sequence $A$ of length $N$. You must partition $A$ into several subsequences such that: - Each element is included in exactly one sub

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start