Air Quality Index Pollution Hotspot Mapping
Air Quality Index Pollution Hotspot Mapping
Sanjana works for an air quality monitoring NGO in Delhi. Given AQI readings from multiple monitoring stations, she needs to identify pollution hotspots by finding regions where AQI exceeds critical thresholds and calculate the affected population area. Rule: cells > threshold form hotspots; regions connect 4-directionally. Return the size (cell count) of the largest hotspot region, 0 if none. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given a 2D grid of AQI values and a critical threshold, find all connected regions where AQI exceeds threshold and return their total area.
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