Tiered Electricity Consumption Bill Generator
Tiered Electricity Consumption Bill Generator
MediumArrays100% accepted
BESCOM in Bangalore uses tiered pricing to calculate monthly electricity bills. Ravi needs to calculate his bill based on consumption and the tier structure.
Approach
Given monthly electricity consumption in kWh and tiered price slabs, calculate the total bill by distributing consumption across tiers.
Input
consumption=250, slabs=[[0,100,5],[101,200,7],[201,300,10]]
Output
1700
More Arrays 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