SalesforceOA #9
Count Numbers with Unique Digits
估计简单可在线判题
考点(AI 标注)哈希计数模拟/实现
Given a list of numbers, count the elements within the 0-based closed index interval [l,r] whose decimal representation has no repeated digits. The interval is not a value range, and repeated valid elements are counted separately. The original example explanation mistakenly wrote 51/60 as 5/6; this site corrects it using the index semantics that all three examples agree on.
输入格式
The first line contains n l r, and the second line contains n non-negative integers. On this site 1≤n≤200000, 0≤l≤r<n, 0≤numbers[i]≤10⁹, written in ordinary decimal without extra leading zeros.
输出格式
Output the number of elements.
样例 1
输入:
8 1 5
1 2 11 55 989 51 60 7007
输出:
2
样例 2
输入:
8 0 7
1 2 11 55 989 51 60 7007
输出:
4
样例 3
输入:
8 5 7
1 2 11 55 989 51 60 7007
输出:
2
样例说明
The three answers are 2, 4, and 2; in the first example, the valid numbers at indices 1..5 are 2 and 51.