Loop to find the consecutive smaller elements at right
while ( j < n - 1 and arr [ j ] > arr [ j + 1 ] ) : NEW_LINE INDENT y += 1 NEW_LINE j += 1 NEW_LINE DEDENT totalPrizes += max ( x , y ) NEW_LINE print ( totalPrizes ) NEW_LINE