Data Structures & AlgorithmsModerateSSC CGL Tier 2 · TCS NQT
Problem: How many positive divisors does the number 2^10 × 3^4 have?
- A. 55
- B. 40
- C. 16
- D. 54
Correct answer: A. 55
A divisor is 2^a · 3^b with 0 ≤ a ≤ 10 and 0 ≤ b ≤ 4, so there are 11 × 5 = 55. Multiplying the exponents gives 40, adding them gives 16, and excluding the number itself gives 54.
More Coding Interview Problems questions
- Problem: What are the last two decimal digits of 3^200?
- Problem: What is the maximum value of a XOR b over all pairs (a, b) taken from the array [3, 10, 5, 25, 2, 8] (a and b may be equal)?
- Problem: The minimum number of characters to delete from "(()))(" to make the parentheses balanced (every ( has a matching ) after it) is…
- Problem: Selection sort is applied to [4, 3, 2, 1] and the number of element moves (assignments into the array) is counted as one per…
- Problem: In a 3-row Pascal-like grid, a cell holds the number of ways to reach it moving only right or down from (0,0), with a blocked…
- Problem: Using Dijkstra from node 0 on the undirected graph with edges (0,1,2), (1,2,2), (0,2,5), (2,3,1), how many nodes have shortest…