If you are a best programmer, can you able to find the answer for the following question?
Q. 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 21000?
I found the answer using Scala programming.
BigInt(2).pow(1000).toString().map(_.asDigit).sum
Can you able to write code to find the answer using your preferred programming language except Scala?
No comments:
Post a Comment