Longest Increasing Subsequence II
For each value, the best run ending just below it within k is a range maximum over values, kept in a segment tree.
For each value, the best run ending just below it within k is a range maximum over values, kept in a segment tree.