Question: please give me java or C solution with using List sumOfDigits(List q) 4. Special Sequence The following sequence is formed using words and numbers: The

 please give me java or C solution with using List sumOfDigits(List

please give me java or C solution with using List sumOfDigits(List q)

4. Special Sequence The following sequence is formed using words and numbers: The first number is 1 In the first number, there was one 1 so the second number is 11 In the second number, there were two 15, so the third number is 21 In the previous number, there was one 2 and there was one 1, so the fourth number is 1211 The next number is 111221, one 1, one 2, two 1's. This sequence can continue infinitely. Given an integer, q[i], determine the sum of the digits of the value in the sequence at that position. For example, position 4 contains the value 1211. The sum of those digits is 1 + 2 + 1 + 1 = 5. Each test case will contain n queries passed as an integer array. Return an array of integers that contains answers for the queried integers. The ith answer should correspond to the ith query

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!