Challenges • Asked over 3 years ago by orlandu8@gmail.com
Here's what I got for the solution
function sumDigits(num) {
let n = num % 9;
if(n === 0) {
return 9;
} else {
return n;
}
}
The challenge says expected time complexity to be O(log n), but unless I'm missing something here. This is O(1) isn't it?