java.lang.Object
g0301_0400.s0357_count_numbers_with_unique_digits.Solution

public class Solution extends Object
357 - Count Numbers with Unique Digits.<p>Medium</p> <p>Given an integer <code>n</code>, return the count of all numbers with unique digits, <code>x</code>, where <code>0 <= x < 10<sup>n</sup></code>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> n = 2</p> <p><strong>Output:</strong> 91</p> <p><strong>Explanation:</strong> The answer should be the total numbers in the range of 0 \u2264 x < 100, excluding 11,22,33,44,55,66,77,88,99</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> n = 0</p> <p><strong>Output:</strong> 1</p> <p><strong>Constraints:</strong></p> <ul> <li><code>0 <= n <= 8</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • countNumbersWithUniqueDigits

      public int countNumbersWithUniqueDigits(int n)