Format Water Meter Consumer Code
Format Water Meter Consumer Code
EasyStrings0% accepted
In Mumbai's water distribution system, consumer codes like 'WM-MUMBAI-DOWNTOWN-12345-RESIDENTIAL' must be reformatted to 'WM_12345_RES' for billing systems.
Approach
Reformat a water meter code 'WM-CITY-ZONE-CONSUMERID-TYPE' to 'WM_CONSUMERID_TYPEABRV' where residential='RES', commercial='COM', industrial='IND'.
Input
WM-MUMBAI-DOWNTOWN-12345-RESIDENTIAL
Output
WM_12345_RES
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