⌘K
Flycodx

Solar Farm Peak Efficiency Window

Solar Farm Peak Efficiency Window

HardArrays0% accepted

A Pune solar farm records hourly energy output in kWh. Engineers identify periods with consistently increasing output as peak efficiency windows. Find the longest increasing period and its total generation.

Approach

Given an array of hourly solar energy outputs, find the longest strictly increasing consecutive subarray and return both its length and total energy sum.

Input

6 100 150 200 180 220 250

Output

[3,450]
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