Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 807838c

Browse files
authored
Merge pull request #86 from u-hossy/feature/add-to-views
backend:algorithm2の修正
2 parents a721245 + 50e1e7c commit 807838c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/app/lib/algorithm2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ def process_warikan_json(input_data: Dict[str, Any]) -> List[Dict[str, Any]]:
174174
if amount == 0 or paid_by_user is None or paid_for_user is None:
175175
continue
176176

177-
#支払った人は貸しだから残高をマイナス
178-
sagaku[paid_by_user] -= amount
179-
#支払ってもらった人は借りだから残高をプラス
180-
sagaku[paid_for_user] += amount
177+
#支払った人は貸しだから残高をプラス
178+
sagaku[paid_by_user] += amount
179+
#支払ってもらった人は借りだから残高をマイナス
180+
sagaku[paid_for_user] -= amount
181181

182182
solve_input_data = [
183183
{"user": user_id, "amount": int(round(amount))}
@@ -196,7 +196,7 @@ def process_warikan_json(input_data: Dict[str, Any]) -> List[Dict[str, Any]]:
196196
output_json_list.append({
197197
"id": j,
198198
"amount": amnt,
199-
"paid_by": from_user,
200-
"paid_for": to_user
199+
"paid_by": to_user,
200+
"paid_for": from_user
201201
})
202202
return output_json_list

0 commit comments

Comments
 (0)