hash table to map the array element with the length of the longest subsequence of which it is a part of and is the last / first element of that subsequence
HashMap < Integer , Integer > inc = new HashMap < Integer , Integer > ( ) ; HashMap < Integer , Integer > dcr = new HashMap < Integer , Integer > ( ) ;