Back to Type Challenges

README

questions/31447-extreme-countreversepairs/README.md

latest1.4 KB
Original Source
<!--info-header-start--><h1>CountReversePairs </h1><blockquote><p>by jiangshan <a href="https://github.com/jiangshanmeta" target="_blank">@jiangshanmeta</a></p></blockquote><p><a href="https://tsch.js.org/31447/play" target="_blank"></a> </p><!--info-header-end-->

Given an integer array nums, return the number of reverse pairs in the array.

A reverse pair is a pair (i, j) where:

  • 0 <= i < j < nums.length and
  • nums[i] > nums[j].
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/31447/answer" target="_blank"></a> <a href="https://tsch.js.org/31447/solutions" target="_blank"></a> <hr><h3>Related Challenges</h3><a href="https://github.com/type-challenges/type-challenges/blob/main/questions/00741-extreme-sort/README.md" target="_blank"></a> <!--info-footer-end-->