Relevant Patterns
#Study these pattern guides before tackling the problems. Understanding the core concepts will help you solve them more efficiently.
Practice Problems
#Hard#315
Show 2 hints
- Process from right; query prefix counts of values < current.
- Coordinate compress values to 1..m.
Hard#493
Show 2 hints
- Count pairs (i<j, nums[i] > 2*nums[j]) via BIT over compressed values.
- Alternatively use mergesort counting.
Hard#1649
Show 2 hints
- Cost is min(count < x, count > x); maintain BIT of frequencies.
- Use modulo arithmetic as required by problem.
Track Your Progress
Mark problems as complete as you solve them. Come back anytime to continue where you left off.