Use dynamic programming:Given an (unsorted) sequence S of n integers from a constant-size universe {1, 2, . . . , 100} (i.e.,
the universe size is 100, a constant), find the longest strictly ascending sub-sequence (not necessarily
contiguous) of integers from the original sequence S such that all these integers in this sub-sequence
are in a strictly ascending order.
For example, consider the following sequence of integers:
S = {1, 20, 14, 7, 9, 30, 77, 15, 20, 60} ,
where s1 = {1, 20, 30, 77} and s2 = {1, 7, 9, 15, 20, 60} are two possible strictly ascending sub-
sequences of S. While there exist more other strictly ascending sub-sequences of S, it can be
verified that s2 is the longest strictly ascending sub-sequence of S.
You are asked to design an algorithm that can solve the above problem in O(n) worst-case time.
You will need to justify the time complexity of your algorithm with appropriate analysis.