Skip to content

Practice Count Numbers with Unique Digits

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#357
LeetCode Problem

Count Numbers with Unique Digits

Problem Statement

Given an integer n, return the count of all numbers with unique digits, x, where 0 <= x < 10^n (10 raised to the power n).

Source: Count Numbers with Unique Digits on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 2
Output
91

# Example 2

Input
n = 0
Output
1

Constraints

0 <= n <= 8

Related LeetCode Problems

Practice more problems similar to Count Numbers with Unique Digits.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.