Overdraft
This commit is contained in:
11
overdraft.py
Normal file
11
overdraft.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
n = int(input())
|
||||||
|
balance = 0
|
||||||
|
min_balance = 0
|
||||||
|
|
||||||
|
for _ in range(n):
|
||||||
|
t = int(input())
|
||||||
|
balance += t
|
||||||
|
if balance < min_balance:
|
||||||
|
min_balance = balance
|
||||||
|
|
||||||
|
print(min_balance * -1 if min_balance < 0 else 0)
|
||||||
Reference in New Issue
Block a user