Zepb

Zepb t1_jbzdpqf wrote

You could use something like (x_1, i_1), (x_2, i_2), ..., (x_k,i_k), ... (first k tuples of value, index) with x_n >= x_m for every n < m (tuples must be ordered by value)

than use the i index numbers from the tuples

edit: just saw there is a similar approach to this with sets in another comment.

2