longest increasing sequence problem