Given a sequence A, write a program that computes the length of its longest increasing subsequence.
A subsequence of A is what you get by picking some elements of A and keeping their original order. An increasing subsequence is one whose values grow from left to right, so the same value may not appear twice in it.
For example, if A={10,20,10,30,20,50}, then the longest increasing subsequence is 10,20,30,50 and its length is 4.