Store all the words with its occurrence
Dictionary < String , int > occ = new Dictionary < String , int > ( ) ; for ( int i = 0 ; i < seq . Count ; i ++ ) if ( occ . ContainsKey ( seq [ i ] ) ) occ [ seq [ i ] ] = occ [ seq [ i ] ] + 1 ; else occ . Add ( seq [ i ] , 1 ) ;