Mumbai Flood Sensor Alert Levels
Mumbai Flood Sensor Alert Levels
MediumArrays0% accepted
Arjun manages flood control systems in Mumbai and needs to identify dangerous water level trends. Rising water levels indicate flood risk, so he must find the longest period of continuously rising or stable water to issue early warnings to residents.
Approach
Given N water level readings from flood sensors, find the length of the longest contiguous subarray where each reading is greater than or equal to the previous reading.
Input
6 2 3 1 4 5 6
Output
4
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