Count Three-Digit Numbers with Distinct Digits
Problem statement
You are given an inclusive range [left, right] containing only three-digit positive integers.
Return how many values in the range have three pairwise distinct decimal digits.
Function
countDistinctThreeDigitNumbers(left: int, right: int) → intExamples
Example 1
left = 876right = 890return = 3The qualifying values are 876, 879, and 890.
Example 2
left = 100right = 105return = 4The qualifying values are 102, 103, 104, and 105.
Constraints
100 <= left <= right <= 999