Data Structures & AlgorithmsHardGATE CS · TCS NQT
How many integers from 1 to 999 inclusive have all decimal digits distinct?
- A. 739
- B. 738
- C. 737
- 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.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- Using coins of value 5, 2 and 1, what is the minimum number of coins that make the amount 11?
- How many positive integers x satisfy x^2 <= 500?
- What is the minimum number of elements of [1, 3, 2, 5, 4, 6] that must be changed (values may be set arbitrarily) so that the array…
- How many trailing zeros does 25! have?
- How many index pairs i < j of [1, 2, 3, 4, 5, 6] have a product strictly less than 20?
- Evaluate the postfix expression "2 3 4 + 5 -".