Data Structures & AlgorithmsHardGATE CS · ICPC regional
What is the smallest positive integer n such that n! has exactly 10 trailing zeros?
- A. 46
- B. 47
- C. 49
- D. 45
Correct answer: D. 45
Trailing zeros of n! change only at multiples of 5; 40! has just 9 zeros, so 10 is first reached at n = 45 and holds until 49.
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
- How many integers x in [1, 1000] have exactly 3 positive divisors?
- What is 2^50 mod 13?
- A frog at 0 wants to reach exactly 12 by jumps of length 2 or 3 to the right. How many different jump sequences take it there?
- Using the pancake operation (reverse any prefix of length at least 2), what is the minimum number of operations to sort the array [3, 1…
- What is the minimum number of coins needed to make 63 from the denominations 1, 5, 10, 21 and 25 (unlimited supply of each)?
- What is the length of the longest strictly increasing subsequence of [10, 9, 2, 5, 3, 7, 101, 18]?