Data Structures & AlgorithmsVery hardTCS NQT · Infosys

How many distinct values in [1, 1, 2, 2, 2, 3, 4, 4] occur more than one third of the time (count times 3 greater than n)?

  1. A. 2
  2. B. 3
  3. C. 1
  4. D. 5

Correct answer: C. 1

With n = 8, a value qualifies when its count exceeds 8/3, that is at least 3. Only 2 occurs three times.

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

Exams that ask this topic