LDS stores the sequences till each element of arr [ ] Traverse the LDS [ ] [ ] to find the the maximum length
for ( int i = 0 ; i < N ; i ++ ) { int x = LDS [ i ] . size ( ) ; maxLength = max ( maxLength , x ) ; }