Air Quality Index String Parser
Air Quality Index String Parser
MediumStrings0% accepted
Environmental engineers at a Bangalore startup process real-time AQI data like 'BNG-KR-PURAM-20260501-14:30:00-156-MODERATE-PM25' to monitor pollution across city zones.
Approach
Parse AQI record 'CITY-ZONE-DATE-TIME-AQI_VALUE-CATEGORY-POLLUTANT' validating AQI (0-500), time (HH:MM), and category matching AQI ranges.
Input
BNG-KR-PURAM-20260501-14:30:00-156-MODERATELY-POLLUTED-PM25
Output
BNG,KR-PURAM,2026-05-01,14:30,156,MODERATELY-POLLUTED
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