Idempotent Matrix

Easy
0/40
6 upvotes
Asked in companies
MeeshoMr. CooperJio Platforms Limited

Problem statement

Given a N * N matrix and the task is to check matrix is idempotent matrix or not.

See the sample input.

Idempotent matrix M follows the following property :

M*M = M
Detailed explanation ( Input/output format, Notes, Images )
Input format :
Line 1 : Size N of the matrix
Line 2 to N + 1 : NXN elements of the matrix
Output Format :
 true or false
Constraints :
 1 <= N <= 10^3
Sample Input :
3
2 -2 -4
-1 3 4
1 -2 -3
Sample Output :
true
Approaches (1)
Time Complexity
Space Complexity
Code Solution
(100% EXP penalty)
Idempotent Matrix
Full screen
Console