Data Structures & AlgorithmsHardCAT · Codeforces Div2 B

How many integers from 1 to 1000 have digit sum exactly 10 and are odd?

  1. A. 32
  2. B. 27
  3. C. 35
  4. D. 30

Correct answer: D. 30

Digit sum 10 and oddness are checked digit by digit; the last digit must be odd, which is what a digit DP would use as a state.

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

Exams that ask this topic