**Count Special Integers solution leetcode** – We call a positive integer **special** if all of its digits are **distinct**.

Given a **positive** integer `n`

, return *the number of special integers that belong to the interval *`[1, n]`

.

Table of Contents

## [Solution] Count Special Integers solution leetcode

Input:n = 20Output:19Explanation:All the integers from 1 to 20, except 11, are special. Thus, there are 19 special integers.

**Example 2:**

Input:n = 5Output:5Explanation:All the integers from 1 to 5 are special.

## [Solution] Count Special Integers solution leetcode

Input:n = 135Output:110Explanation:There are 110 integers from 1 to 135 that are special. Some of the integers that are not special are: 22, 114, and 131.

**Constraints:**

`1 <= n <= 2 * 10`

^{9}