Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many integers x in [1, 100] are divisible by 3 and have a reversed digit string also divisible by 3?

  1. A. 34
  2. B. 35
  3. C. 37
  4. D. 33

Correct answer: D. 33

Digit reversal preserves the digit sum, so divisibility by 3 is unchanged by reversal. Any x divisible by 3 satisfies the reverse condition too.

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

Exams that ask this topic