Geek and Allies
Input: N = 13Output: 12Explanation: 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 = 500Output: 184Solution:

Comments
Post a Comment