This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingCount pairs where the earlier value exceeds twice the later one.
What this asks
Count pairs where the earlier value is more than twice the later one.
Merge sort with a count step, or a compressed Fenwick tree over the doubled values.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing