• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
April 24, 2024 |570 Views
PROBLEM OF THE DAY : 23/04/2024 | Rohan's Love for Matrix
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Nitin Kaplas . We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Matrix but also build up problem-solving skills.

In this problem, Rohan has a special love for the matrices especially for the first element of the matrix. Being good at Mathematics, he also loves to solve the different problem on the matrices. So one day he started to multiply the matrix with the original matrix.  The elements of the original matrix a are given by [a00=1 , a01=1, a10=1, a11=0].
Given the power of the matrix, n calculate the an and return the a10 element mod 1000000007.

Example :

Input: 
n = 3
Output: 


Explanation: Take the cube of the original matrix i.e. a3 and the (a10)th element is 2.

Give the problem a try before going through the video. All the best!!!
Problem Link: https://www.geeksforgeeks.org/problems/rohans-love-for-matrix4723/1

Read More