Data Structures & AlgorithmsVery hardICPC regional · CAT · MBA placement
Problem: The number 2024 is factorised. How many positive integers less than 10000 are divisors of 2024 × 2025?
- A. 168
- B. 240
- C. 31
- D. 120
Correct answer: A. 168
2024 = 2³·11·23 and 2025 = 3⁴·5² are coprime, so the product has 16 × 15 = 240 divisors, of which 168 are below 10000. Forgetting the bound gives 240, adding the counts gives 31, and halving 240 wrongly assumes 10000 is the square root.
More Coding Interview Problems questions
- Problem: How many subarrays of [1, 2, 3, 1, 2, 3, 4] contain exactly 3 distinct values? Run the brute-force code. python a = [1, 2, 3, 1…
- Problem: How many integers in [1, 1000] are divisible by 7, 11 or 13? Run the code. python print(sum(1 for x in range(1, 1001) if x % 7 ==…
- Problem: What is the number of trailing zeros in 2025! (in decimal)? Run the code. python n = 2025 c = 0 p = 5 while p <= n: c += n // p p…
- Problem: What is the sum of all distinct prime factors of 2025? Run the code. python n = 2025 f = 2 ps = set() while f f <= n: while n % f…
- Problem: How many integers x in [1, 500] have x^2 + x + 41 prime? Run the code. python def isp(n): return n > 1 and all(n % d for d in…
- Problem: What is the length of the longest subarray of [2, 4, 6, 3, 8, 10, 12] whose elements are all even? Run the code. python a = [2…