Data Structures & AlgorithmsHardGATE CS · TCS NQT
How many trailing zeros does 2^7 * 5^4 * 10 have in decimal?
- A. 6
- B. 5
- C. 4
- D. 7
Correct answer: B. 5
Each factor of 10 needs a 2 and a 5, so the trailing zeros count min(exponent of 2, exponent of 5) with the extra 10 contributing one each. Here the exponents of 2 and 5 are 8 and 5, so the answer is 5.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- What is the number of unmatched '(' characters in the string "(()())(()" after the standard left-to-right matching?
- What is the largest number of distinct characters in any contiguous window of length 4 of "abcbdabca"?
- What is the sum of all positive divisors of 36?
- How many contiguous subarrays of [2, 4, 1, 3] have a sum in the inclusive range [4, 6]?
- How many distinct subsequences (including the empty string) does "aab" have?
- How many pairs (a, b) with 1 <= a <= b <= 20 satisfy a b = 36?