Longest rising subsequence nlgn source code