Ezvor

3907. Count Smaller Elements With Opposite Parity

Medium Preparing judge… LeetCode

Hints

Hint 1
Use a data structure to keep track of elements of different parities.
Hint 2
For the current index, query the data structure for elements to the right with different parity and a smaller value.