New update is available. Click here to update.

Posted: 8 Mar, 2021

Difficulty: Easy

```
The first line of the input contains an integer, 'T’ denoting the number of test cases.
The first line of each test case contains two space-separated integers, 'N' and 'K', denoting the number of elements in the array 'ARR', and the special number respectively.
The second line of each test case contains 'N' space-separated integers denoting the elements of the array 'ARR'.
```

```
For each test case, print the minimum number of transactions needed to make the wallet balance of all the friends equal.
Print the output of each test case in a new line.
```

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

```
1 <= T <= 10
1 <= N <= 10^5
1 <= K <= 10^4
0 <= ARR[i] <= 10^4
Where 'ARR[i]' represents the ith element of 'ARR'.
Time Limit: 1 sec
```

SIMILAR PROBLEMS

Missing Number

Posted: 30 Oct, 2022

Difficulty: Easy

Longest Subarray With Zero Sum

Posted: 3 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Ninja And The Strictly Increasing Array

Posted: 27 Nov, 2022

Difficulty: Moderate

Negative To The End

Posted: 16 Dec, 2022

Difficulty: Easy

Popular Interview Problems: