Last active
May 14, 2020 17:03
-
-
Save kenzhemir/b31eb06cd3bfbd1c49fc06a1c7564bdf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} n | |
* @return {number} | |
*/ | |
var countNumbersWithUniqueDigits = function(n) { | |
switch(n) { | |
case 0: | |
return 1; | |
case 1: | |
return 10; | |
case 2: | |
return 91; | |
case 3: | |
return 739; | |
case 4: | |
return 5275; | |
case 5: | |
return 32491; | |
case 6: | |
return 168571; | |
case 7: | |
return 712891; | |
case 8: | |
return 2345851; | |
case 9: | |
return 5611771; | |
default: | |
return 8877691; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment