Bank Account Overdraft Detection
Bank Account Overdraft Detection
Arjun tracks his ICICI bank account transactions in Mumbai. An array contains debits (negative) and credits (positive). He needs to identify all transaction indices where his account balance went negative (overdraft), which triggers penalty fees. Rule: starting balance is 0; process transactions in order and return all 0-based indices where the running balance is negative after the transaction. Return [] if none. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given an array of transactions (positive for deposits, negative for withdrawals), find all indices where cumulative balance becomes negative.
Input
Output
More Arrays problems
Browse all coding problems →Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards