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?
- A. 34
- B. 35
- C. 37
- 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.
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
- What is the sum of all divisors of 36 (sigma function)?
- How many unordered pairs {a, b} with 1 <= a < b <= 12 have a + b divisible by 4?
- What is the product of all positive divisors of 36?
- A robot starts at (0, 0) and performs the moves L, U, R, R, D, D, L, U, U, R, R. Moves L/R change x, U/D change y. What is the Manhattan…
- How many integers x in [1, 1000] have digit sum equal to 9 and are divisible by 9?
- There are 7 people in a circle numbered 1 to 7. Starting at person 1 and counting 1, 2, 3, ..., every 3rd person is removed until one…