Data Structures & AlgorithmsHardTCS NQT · Accenture
How many triples a < b < c with a, b, c in [1, 10] satisfy a + b = c?
- A. 21
- B. 22
- C. 20
- D. 24
Correct answer: C. 20
For each pair a < b with a + b <= 10, the value c = a + b is determined and automatically greater than b, so each valid pair gives one triple.
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 minimum number of characters that must be deleted from aabbaa so that no two adjacent characters of the remaining string are…
- How many distinct strings can be obtained from aabb by removing exactly one character?
- What is the sum of the decimal digits of 100!?
- How many trailing zeros does 1000! have in base 10?
- How many integers x in [1, 300] satisfy x ≡ 1 (mod 4) and x ≡ 2 (mod 3)?
- What is Euler's totient phi(360), the number of integers in [1, 360] coprime to 360?