Just try my intuition and it passed all tests:

```
public class Solution {
public int minTransfers(int[][] trans) {
Map<Integer, Integer> net = new HashMap<>();
for(int i = 0; i < trans.length; i++){
net.put(trans[i][0], net.getOrDefault(trans[i][0], 0) - trans[i][2]);
net.put(trans[i][1], net.getOrDefault(trans[i][1], 0) + trans[i][2]);
}
int res = 0;
PriorityQueue<Integer> pos = new PriorityQueue<>(Collections.reverseOrder());
PriorityQueue<Integer> neg = new PriorityQueue<>();
for(int i : net.values()){
if(i > 0) pos.offer(i);
if(i < 0) neg.offer(i);
}
while(!pos.isEmpty() && !neg.isEmpty()){
res++;
int temp = pos.poll() + neg.poll();
if(temp > 0) pos.offer(temp);
if(temp < 0) neg.offer(temp);
}
return res;
}
}
```