Data Structures & AlgorithmsHardTCS NQT · Accenture

How many triples a < b < c with a, b, c in [1, 10] satisfy a + b = c?

  1. A. 21
  2. B. 22
  3. C. 20
  4. 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.

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

Exams that ask this topic