Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

What is the number of trailing zeros in the decimal representation of the product 10 * 25 * 4 * 15 * 50?

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

Correct answer: C. 4

Trailing zeros equal min(v2, v5) of the product. Counting factors of 2 and 5 separately per element gives the same answer as multiplying out the product.

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

Exams that ask this topic