Fill positions of each character in vector
List < int > [ ] position = new List < int > [ M ] ; for ( int i = 0 ; i < M ; i ++ ) position [ i ] = new List < int > ( ) ; for ( int i = 1 ; i <= n ; i ++ ) position [ str2 [ i - 1 ] - ' a ' ] . Add ( i ) ; int [ , ] lcsl = new int [ m + 2 , n + 2 ] ; int [ , ] lcsr = new int [ m + 2 , n + 2 ] ;