Suppose we are given an array, A of n positive numbers (or a string of n characters). A = [a1,a2,....,an]. An increasing subsequence of A is a subsequence, {aia, ai2,...., aik}, of elements from A such that ij < ij+1 and aij < aij+1 for each 1 <= j < k. Notice that the elements in the increasing subsequence need not be contigous in A. Given an increasing subsequence of A, we can compute the length of this subsequnce. The longest increasing sub