How to find the sum of squares of individual digits of a number without using looping statements?(to reduce time complexity) | SoloLearn: Learn to code for FREE!

0

How to find the sum of squares of individual digits of a number without using looping statements?(to reduce time complexity)

2/24/2017 6:24:21 AM

Aniket Patil

1 Answer

New Answer

0

how large is your number? if it is a 10 digit number, it can be looped 10 times and the square of each digit is added to variable. I can't think of a better solution in terms of time complexity.