Rank of Matrix
Submissions: 840   Accuracy:

56.04%

  Difficulty: Medium   Marks: 4

Write a program to find the rank of a 3x3 Matrix.

Input: The first line contains an integer 'T' denoting the total number of test cases. Each test case consists of 3 lines and each line consists of 3 integers. First 3 lines denotes a matrix of whose rank is to be determined.  
Output: Rank of the matrix is displayed in one line.
Constraints:

1 <=T<= 100

-100 <=N<= 100
Example:

Input: 

2
10 20 10
-20 -30 10
30 50 0
2 4 3
1 0 9
9 6 8

Output:

2
3

** For More Input/Output Examples Use 'Expected Output' option **

Author: atharv


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.