How Many Digits?

Published by Werdna in

Given an integer n. Your task is to find how many digits this integer contains without using String or Array methods!

Examples

sum_digits(100) ➞ 3

sum_digits(1000) ➞ 4

sum_digits(1) ➞ 1

Notes

N/A

Watch a quick demo on how Edabit works.