UPI Multi-Bank Routing Cost Minimization
UPI Multi-Bank Routing Cost Minimization
User needs to send ₹50,000 through UPI. Different banks have fee structures: HDFC charges ₹0 for ≤50k, ICICI charges ₹500 for ≤100k, Axis charges ₹1000 for ≤200k. Find minimum cost routing through intermediary banks. Rule: each bank is [limit, fee]; the transfer can use any single bank whose limit >= amount. Return the minimum fee, or -1 if no bank can handle it. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given banks with fee/limit arrays, find minimum cost path routing amount through multiple banks
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