Counting Inversions via Rank Queries | Hacker News Reader