Data Structures & AlgorithmsModerateICPC regional · Amazon SDE OA

How many integers from 1 to 60 inclusive have exactly four positive divisors?

  1. A. 20
  2. B. 18
  3. C. 19
  4. D. 1

Correct answer: C. 19

Numbers with four divisors are products of two distinct primes or cubes of primes. Counting divisors by trial division confirms the answer for this range.

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

Exams that ask this topic