Data Structures & AlgorithmsHardTCS NQT Digital · ICPC regional
Problem: The number 1729 is written in base 10. What is the sum of its digits in base 12, given as the digit sum of 1729 written in base 12?
- A. 3
- B. 2
- C. 1
- D. 4
Correct answer: B. 2
Convert 1729 to base 12 (it is 1001 in base 12) and add its digits, giving 2. The base change matters; summing the base-10 digits gives 19.
More Coding Interview Problems questions
- Problem: A sorted list has values 3, 7, 7, 9, 12, 12, 12, 15. How many distinct values lie within the range [7, 12] inclusive?
- Problem: On a 3×3 grid, each cell is labelled with its row times column (1-indexed). The number of cells whose label is a perfect square…
- Problem: How many integers in [1, 100] have exactly 3 divisors? Run the code. python print(sum(1 for x in range(1, 101) if sum(1 for d in…
- Problem: What is the sum of the digits of 3^20? Run the code. python print(sum(int(c) for c in str(3 20))) What is printed?
- Problem: How many paths of length 3 exist in a complete graph K4 that start and end at different vertices? Run the code (count ordered…
- Problem: What is the number of integers in [1, 1000] whose digits are all odd? Run the code. python print(sum(1 for x in range(1, 1001) if…