Geek and Allies


 Input: N = 13
Output: 12
Explanation: Identification codes of Geek's 
allies are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12 
and 13. Person with Identification code 10 
cannot be an ally as 10 is not the smallest 
permutation of the digits '0' and '1'. 


Example 2:

Input: N = 500
Output: 184

Solution:



Comments

Popular posts from this blog

pattern ####/\#### ###/##\### ##/#/\#\## #/#/##\#\# /#/#/\#\#\ \#\#\/#/#/ #\#\##/#/# ##\#\/#/## ###\##/### ####\/####