Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Reverse Pairs
Bookmark
Input
Standard
Medium
Small
Large
No Pairs
All Same
Custom
arr
=
[1, 3, 2, 3, 1]
nums[i] > 2·nums[j]
pairs = 0
0
1
2
3
4
1
3
2
3
1
count pairs i < j with nums[i] > 2·nums[j]
algo
master
.
io
Step:
Start: Count reverse pairs using modified merge sort
0 / 71
Input
Standard
Medium
Small
Large
No Pairs
All Same
Custom
arr
=
[1, 3, 2, 3, 1]
0 / 71
nums[i] > 2·nums[j]
pairs = 0
0
1
2
3
4
1
3
2
3
1
count pairs i < j with nums[i] > 2·nums[j]
algo
master
.
io
Step:
Start: Count reverse pairs using modified merge sort