Home | Projects | Notes > Problem Solving > LC - E - 258. Add Digits

LC - E - 258. Add Digits

 

Solutions in C++

Solution 1

This solution uses iteration.

Complexity Analysis:

Solution:

Solution 2

This solution uses iteration. Notice how this solution improves the Solution 1 in the time complexity.

Complexity Analysis:

Solution: