Map that marks the occurrence of a number
Dictionary < int , int > m = new Dictionary < int , int > ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) m [ i ] = 0 ; for ( int i = 0 ; i < l ; i ++ ) m [ s [ i ] - '0' ] ++ ;