Data Structures & AlgorithmsModerateTCS NQT · SSC CGL Tier 2
Problem: The product 2^3 · 3^2 · 5^1 · 7^2 has how many positive divisors?
- A. 12
- B. 36
- C. 17640
- D. 72
Correct answer: D. 72
Divisor count = (3+1)(2+1)(1+1)(2+1) = 4 · 3 · 2 · 3 = 72. Adding the (e + 1) terms (or multiplying the exponents) gives 12, dropping the factor for 5 gives 36, and 17640 is the number itself.
More Coding Interview Problems questions
- Problem: For the array [1, 3, 5, 7, 9], how many subarrays have an average equal to 5?
- Problem: The string "aabbccdd" has all its letters doubled. How many substrings of length 2 consist of two identical letters?
- Problem: A 2×4 grid has a wall at (0,2) (row, column, 0-indexed); all other cells are open. Moves go up, down, left or right. What is the…
- Problem: The complete directed graph on 4 vertices has an arc in both directions between every pair of distinct vertices. How many…
- Problem: The path graph P4 has vertices 1–4 and edges 1-2, 2-3, 3-4. How many edges does its complement graph (on the same vertices…
- Problem: A complete binary tree has 15 nodes (height 3, all levels full). How many of its nodes are leaves?