Unordered map of type string
HashSet < string > us = new HashSet < string > ( ) ; for ( int i = 0 ; i + k <= s . Length ; i ++ ) { us . Add ( s . Substring ( i , k ) ) ; } return us . Count == 1 << k ; }