Surpasser number


  • 0
    S

    Surpasser
    Calculate the surpasser number for every number in the array. Surpasser is defined as the number of elements greater than the current element, that are located at the right side of the element.
    For example:

    Example1:
    input = [1,2,3,4,5]
    output = [4,3,2,1,0]

    Example2:
    input = [10,2,-2,5,4]
    output = [0,2,2,1,0]

    1.1) Follow up: Compute the max surpasser of the array.
    For example1: max_surpasser = 4
    For example2: max_surpasser = 2


  • 1
    R

    @seulunga This looks a lot like 315. Count of Smaller Numbers After Self, with "smaller" replaced with "greater" instead.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.