creating a hashMap to add characters in string s2
Dictionary < char , int > m = new Dictionary < char , int > ( ) ; for ( i = 0 ; i < s2 . Length ; i ++ ) if ( ! m . ContainsKey ( s2 [ i ] ) ) m . Add ( s2 [ i ] , 1 ) ;