Count Debit Transactions in Statement
Count Debit Transactions in Statement
EasyStrings100% accepted
Ravi reviews his monthly bank statement on HDFC NetBanking and wants to count how many debit transactions (money outflows) he made to monitor his spending.
Approach
Given a comma-separated list of transactions in format 'TransactionType:Amount', count how many transactions are of type 'DEBIT'.
Input
DEBIT:5000,CREDIT:2000,DEBIT:3000,CREDIT:1500
Output
2
More Strings problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
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