相关疑难解决方法(0)

增长最快的子序列

给定输入序列,找到最长(不一定是连续的)非递减子序列的最佳方法是什么.

0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 # sequence

1, 9, 13, 15 # non-decreasing subsequence

0, 2, 6, 9, 13, 15 # longest non-deceasing subsequence (not unique)
Run Code Online (Sandbox Code Playgroud)

我正在寻找最好的算法.如果有代码,Python会很好,但一切都没问题.

python language-agnostic algorithm

31
推荐指数
2
解决办法
3万
查看次数

标签 统计

algorithm ×1

language-agnostic ×1

python ×1