Data Structures & AlgorithmsHardICPC regional · TCS NQT

Problem: The number 1000000007 is used as a modulus in competitive programming. How many times does the decimal digit 7 appear in the decimal representation of 2^64?

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

Correct answer: B. 3

Compute the power exactly and count the digit 7 in its decimal string. Estimating from the number of digits gives no digit-specific count.

More Coding Interview Problems questions

Exams that ask this topic