Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
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.
26th Feb 2017, 4:01 AM
vivek
vivek - avatar