New update is available. Click here to update.

Last Updated: 27 Nov, 2020

Difficulty: Easy

```
(a) The maximum number of linearly independent column vectors in the matrix or
(b) The maximum number of linearly independent row vectors in the matrix. Both definitions are equivalent.
```

```
In the theory of vector spaces, a set of vectors is said to be linearly dependent if there is a nontrivial linear combination of the vectors that equals the zero vector. If no such linear combination exists, then the vectors are said to be linearly independent.
```

```
The first line contains a single integer ‘T’ denoting the number of test cases.
The first line of every test case contains two space-separated integers, ‘N’ and ‘M’, denoting the number of rows and the number of columns respectively.
Then each of the next ‘N’ rows contains ‘M’ elements.
```

```
For each test case, return the rank of the matrix.
```

```
You do not need to print anything. It has already been taken care of. Just implement the given function.
```

```
1 <= T <= 10
1 <= N , M <= 500
-10^4 <= Arr[i][j] <= 10^4
Where ‘ARR[i][j]’ denotes the matrix element at the jth column in the ith row of ‘ARR’
Time Limit: 1 sec
```

SIMILAR PROBLEMS

SudoKube

Posted: 18 May, 2022

Difficulty: Ninja

SudoKube

Posted: 18 May, 2022

Difficulty: Ninja

SudoKube

Posted: 18 May, 2022

Difficulty: Ninja

King Placement

Posted: 22 May, 2022

Difficulty: Moderate

Ninja and the experiment

Posted: 5 Sep, 2022

Difficulty: Moderate

Search In A Sorted 2D Matrix

Posted: 23 Nov, 2022

Difficulty: Moderate

Spiral Matrix

Posted: 24 Nov, 2022

Difficulty: Easy

Popular Interview Problems: