Given an int array which might contain duplicates, find the largest subset of it which form a sequence. Ex: {1,6,10,4,7,9,5} then ans is 4,5,6,7
Sorting is an obvious solution. Can this be done in O(n) time ??
Thanks in advance :)
Subsequence Problem
Given an int array which might contain duplicates, find the largest subset of it which form a sequence. Ex: {1,6,10,4,7,9,5} then ans is 4,5,6,7
Sorting is an obvious solution. Can this be done in O(n) time ??
Thanks in advance :)
Rev. | Язык | Кто | Когда | Δ | Комментарий | |
---|---|---|---|---|---|---|
en1 | harrypotter0 | 2017-09-19 16:52:12 | 262 | Initial revision (published) |