Wednesday, September 13, 2017

[LeetCode]Increasing Subsequences


很直观的backtracking类的题目,不需要多讲,要注意去重。关于去重的思路可以参考Permutations II。时间复杂度O(k),k为IS(Increasing Subsequences)的数量,空间复杂度O(d),d为最长的IS。代码如下:


No comments:

Post a Comment