Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Last digit of sum of partial Fibonacci Series

Problem statement:

Given two non-negative integers m and n, where m <= n, find the last digit of the sum Fm + Fm+1 + .... + Fn

Input:

Two non negative intergers m and n, such that m <= n.

Output:

The last digit of the sum of Fibonacci series starting from Fm to Fn.

Example:

Input:

3 7

Output:

1

Explanation:

𝐹3 + 𝐹4 + 𝐹5 + 𝐹6 + 𝐹7 = 2 + 3 + 5 + 8 + 13 = 31
Last digit of 31 = 1