Kerala Coconut Farm Harvest Scheduling
Kerala Coconut Farm Harvest Scheduling
MediumArrays100% accepted
Nisha manages coconut farms in Kerala and schedules labor-intensive harvesting operations. She needs to find consecutive days with mature coconuts to plan harvest teams and logistics efficiently. Input: first value N (number of days), then threshold M, then N maturity levels. Return the longest streak of consecutive days with maturity >= M.
Approach
Given N daily coconut maturity levels and maturity threshold M, find the length of the longest period where all maturity levels are >= M.
Input
7 60
50 65 75 55 80 90 70
Output
3
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