← 返回 stripe 的题目列表Balance Calculation and Rejected Transactions
类型:online_judge
Given a list of transactions, output all users with a non-zero balance and their balances. Then output transactions that would cause a balance to be negative in a rejected transaction list and again output users with a non-zero balance and their balances. Example input:
account_name, timestamp, currency, amount
acct_123,1,usd,1000
acct_123,2,usd,500
acct_321,3,usd,400
acct_321,4,usd,-500
Example output:
acct_321 and 1500, acct_312 and 400, rejected_transaction = ["acct_321,4,usd,-500"]
Example
Input
account_name, timestamp, currency, amount
acct_123,1,usd,1000
acct_123,2,usd,500
acct_321,3,usd,400
acct_321,4,usd,-500