Longest increasing subsequence:

Normally the aux buffer aux[i] stores the maximised length of the
subsequence ending at i. In case we want to find the length of the
subsequence *starting* from i we run the algorithm in the reverse order
with the opposite comparator (essentially LIS from left to right is
equivalent to LDS from right to left, but the second will yield
information of the subsequence lengths starting from each position)