Skip to content

Commit e37a8ff

Browse files
authored
Update optimal-account-balancing.cpp
1 parent ced729e commit e37a8ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/optimal-account-balancing.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class Solution {
66
int minTransfers(vector<vector<int>>& transactions) {
77
unordered_map<int, int> account;
88
for (const auto& transaction : transactions) {
9-
account[transaction[0]] -= transaction[2];
10-
account[transaction[1]] += transaction[2];
9+
account[transaction[0]] += transaction[2];
10+
account[transaction[1]] -= transaction[2];
1111
}
1212
vector<int> debts;
1313
for (const auto& [_, debt] : account) {

0 commit comments

Comments
 (0)