Number of digits
Easy Accuracy: 0.0% Submissions: 1 Points: 2

Given a number N, find the number of digits in the Nth Fibonacci Number.
 

Example 1:

Input:
N = 5
Output:
1
Explanation:
5th fibonacci number is 5
which contains only one digit

Example 2:

Input:
N = 12
Output:
3
Explanation:
12th fibonacci number is 144
which contains three digits


Your Task:
You don't need to read input or print anything. Your task is to complete the function noOfDigits() which takes an integer N as input parameters and returns an integer, number of digits in Nth Fibonacci number

 

Expected Time Complexity: O(1)
Expected Space Complexity: O(1)

 

Constraints:
1 <= N <= 103

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.