Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many integers from 1 to 999 inclusive have all decimal digits distinct?

  1. A. 739
  2. B. 738
  3. C. 737
  4. D. 648

Correct answer: B. 738

One-digit values give 9, two-digit values with distinct digits give 9 * 9 = 81, and three-digit values give 9 * 9 * 8 = 648, for a total of 738.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic