FastPrepCount Numbers Without Repeating Digits Data & Analytics

Count Numbers Without Repeating Digits Data & Analytics

JP Morgan Chase logoJP Morgan ChaseEasyINTERNOA
Learn

Problem statement

Given a range of elements, print the number of elements in the range without repeating digits. For example, the result for the range 10-13 is 3 (since 10, 12, and 13 are the valid numbers, but 11 is not because it has repeating digits).

Function

countNumbersWithoutRepeatingDigits(start: int, end: int) → int

Examples

Example 1

start = 10end = 13return = 3

The valid numbers in the range 10-13 are 10, 12, and 13. The number 11 is not valid because it has repeating digits. Therefore, the count of numbers without repeating digits is 3.

Constraints

  • 🥝

More JP Morgan Chase problems

See JP Morgan Chase hiring insights
public int countNumbersWithoutRepeatingDigits(int start, int end) {
  // write your code here
}
start10
end13
expected3
Checking account…