powered by
Sum of the higher terms of a list
sum_g(L, m)
The sum of the m higher terms of the list L
A numeric sequence
A scalar
Cesar Asensio
It sorts the list L in decreasing order and returns the sum of the first m components of the ordered list.
sum_g(1:10, 3) # 8 + 9 + 10 = 27
Run the code above in your browser using DataLab