⌘K
Flycodx

Validate Water Meter Reading Format

Validate Water Meter Reading Format

MediumStrings0% accepted

Mumbai water department receives meter readings in format 'ZONE_METERTYPE_READING_UNIT' like 'NA_DOM_12345_L' (North Arpita, Domestic, 12345 liters). Validate format consistency in batch readings to ensure data quality.

Approach

Given comma-separated meter reading strings in format ZONE_TYPE_VALUE_UNIT, count how many follow valid format (ZONE is 2 chars, TYPE is DOM/COM/IND, VALUE is numeric, UNIT is L or M3).

Input

NA_DOM_12345_L,WA_COM_54321_M3,BA_DOM_99999_L

Output

3
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
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3