File size: 518 Bytes
7428366
1
Write a Python CLI: stdin is one JSON object with balances (list of nonnegative integers) and transfers (list of [from_index,to_index,amount]). Apply each transfer only if indices exist, amount is nonnegative, and the source has enough funds. Rejected transfers do not change balances; count them. Print JSON {"balances":...,"rejected":...}. Self transfers are valid if funds suffice. You may assume the JSON shape and integer types are valid. Return one complete fenced code block with all imports and no explanation.