Data Structures & AlgorithmsHardICPC regional · TCS NQT Digital
Problem: In base 8, how many trailing zeros does 100! have?
- A. 24
- B. 97
- C. 32
- D. 48
Correct answer: C. 32
v₂(100!) = 50 + 25 + 12 + 6 + 3 + 1 = 97, and each base-8 zero needs three 2s, so ⌊97/3⌋ = 32. 24 is the decimal zero count, 97 the raw power of 2, and ⌊97/2⌋ = 48 is the base-4 count.
More Coding Interview Problems questions
- Problem: What is the sum of the divisors of 360 that are perfect squares?
- Problem: How many integers from 1 to 200 are both perfect squares and perfect cubes?
- Problem: Compute 7^2024 modulo 9.
- Problem: What is the multiplicative inverse of 3 modulo 11 (the value x with 0 ≤ x < 11 and 3x ≡ 1 mod 11)?
- Problem: The k = 2 closest points to the origin are chosen from the list (1,3), (−2,2), (5,8), (0,1). Compute the sum of the squared…
- Problem: Intervals [1,4], [3,7] and [6,10] are available. What is the minimum number of these intervals needed to cover the whole segment…