The TransCompilator

Solved LeetCode program · 365 of 1,000

#0493 · Reverse Pairs

Hard Array chunk-08.md

Original English source

The numbers is a list of 1, 3, 2, 3, 1. The last is the last position of numbers. The count is 0.
For every first from 0 to last.
For every second from first plus 1 to last.
If item first of numbers is more than 2 times item second of numbers, add 1 to count.

Show count.

Open in Playground Browse all 1,000 problems

Expected stdout

2