Given an integer n, return the number of digits in n.
n
0
For example, 12345 has 5 digits, -42 has 2 digits, and 0 has 1 digit.
12345
-42
n = 12345
5
n = -42
2
n = 0
1
-10^9 <= n <= 10^9
Run your code to see results
Use Cmd+Enter to run