⚠️ Blockly failed to load. Check your internet connection and refresh.
Bank Account
Problem
A bank account starts with B euros.

Over the next N days, a series of transactions happen. Each transaction is a positive number (deposit) or a negative number (withdrawal).

Simulate the transactions in order. Output two things:
• The peak balance (the highest the balance ever reaches).
• Whether the account is valid (the balance never goes below zero): print 1 for valid, 0 for invalid.
Input Variables (pre-loaded)
💡 Drag N, B, and transaction at day i from the Inputs category.
Your Output
Result
Run your program to see the result. Print the peak balance first, then the valid flag (1 or 0).
Execution Log
Ready. Press ▶ Run to start.
Expected Answer
Answer:
?
Hint