Data Structures & AlgorithmsModerateTCS NQT Digital · CAT

Problem: How many two-digit numbers (10–99) have digits that sum to exactly 9?

  1. A. 10
  2. B. 9
  3. C. 90
  4. D. 8

Correct answer: B. 9

Two-digit numbers with digit sum 9: 18, 27, 36, 45, 54, 63, 72, 81, 90 = 9. Counting two-digit multiples of 9 adds 99 (digit sum 18) for 10, 90 counts all two-digit numbers, and forgetting 90 gives 8.

More Coding Interview Problems questions

Exams that ask this topic