Data Structures & AlgorithmsHardGATE CS · TCS NQT
What is the digital root of the product 9 * 18 * 27 * 34?
- A. 7
- B. 9
- C. 10
- D. 0
Correct answer: B. 9
Digital root is n mod 9 (with 9 instead of 0); any product containing a factor 9 has digital root 9. The product is divisible by 9, so the root is 9.
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
- Which string is the longest common prefix of ["flower", "flow", "flight", "flute", "fly"]?
- Items (value, weight) = (60, 10), (100, 20), (120, 30) can be split fractionally. With capacity 50, what is the maximum total value?
- How many windows of size 3 in [1, 2, 2, 3, 4, 4, 5] have every pair of adjacent elements inside the window different?
- How many contiguous subarrays of [3, 1, 2, 1, 4] have their minimum equal to their first element?
- How many entries of [1, 6, 8, 12, 16, 33, 64, 0] are powers of two (with 1 counted)?
- What is the length of the longest contiguous subarray of [0, 1, 0, 0, 1, 1, 0, 1] containing equal numbers of 0s and 1s?