Data Structures & AlgorithmsModerateGATE CS · TCS NQT
How many integers x in [1, 500] have digit sum equal to 10?
- A. 44
- B. 45
- C. 47
- D. 43
Correct answer: D. 43
Split by the hundreds digit and count the tens and units pairs with the required sum; 500 itself has digit sum 5 and does not count.
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
- How many unordered pairs {a, b} with a < b and 1 <= a, b <= 30 have a b a perfect square?
- An array is [1, 2, 1, 2, 1, 2] (indices 0 to 5). How many pairs of even-indexed positions i < j hold equal values?
- What is the sum of all proper divisors of 220 (divisors less than 220)?
- How many integers in [1, 100] have an odd number of positive divisors?
- What is the last digit of 3^2024?
- How many strings of length 4 over the alphabet {0, 1, 2} have no two adjacent characters equal?