Leaderboard
Showing:
Handle Score
@Ibrahim Nash 5725
@blackshadows 5685
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4908
@saiujwal13083 4156
@sanjay05 3762
@marius_valentin_dragoi 3511
@sushant_a 3453
@KshamaGupta 3318
@the_coder95 3302
Complete Leaderboard
nth digit of Fibonacci
Basic Accuracy: 32.37% Submissions: 68 Points: 1

A Fibonacci series (starting from 1) written in order without any spaces in between, thus producing a sequence of digits. Find the nth digit in the sequence.

Example 1:

Input: n = 3
Output: 2 
Explanation: 3rd digit of fibonacci 
series is 2(1123.....).

Example 2:

Input: n = 7
Output: 1
Explanation: 7th digit of fibonacci
series is 1(11235811.....).


Your Task:  
You dont need to read input or print anything. Complete the function nthFibonacciDigit() which takes n as input parameter and returns nth digit of fabonacci series. 

Expected Time Complexity: O(n
*m)
Expected Auxiliary Space: O(n)

Constraints:
1<= n <=100

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.

nth digit of Fibonacci

Output Window