Compute longest increase sequence