Placement AptitudeHardTCS NQT Advanced · CAT

How many of the numbers from 1 to 1000 contain the digit 7 at least once?

  1. A. 300
  2. B. 271
  3. C. 729
  4. D. 252

Correct answer: B. 271

Write 1 to 999 as 3-digit strings 001 to 999 and add 000 in place of 1000 (neither has a 7). Strings with no 7: 9³ = 729, so 1000 − 729 = 271 contain a 7. 300 counts 7 in each place separately and double-counts.

More Permutations, Combinations and Probability (Placement) questions

Exams that ask this topic