Challenge: Last Digit of the Sum of Fibonacci Numbers

Solve the Last Digit of the Sum of Fibonacci Numbers Problem.

We'll cover the following

Problem


Last Digit of the Sum of Fibonacci Numbers Problem

Compute the last digit of F0+F1++FnF_{0} + F_{1} + \ldots + F_{n}.

Input: An integer nn.

Output: The last digit of F0+F1++FnF_{0} + F_{1} + \ldots + F_{n}


Level up your interview prep. Join Educative to access 70+ hands-on prep courses.