⌘K
Flycodx

Tiger Migration Corridor Path Optimization

Tiger Migration Corridor Path Optimization

HardArrays0% accepted

Ravi from Karnataka Forest Department tracks tiger migration routes. A 1D array represents habitat quality scores along a potential corridor. Tigers need spacing to avoid territorial conflicts, so he must select non-adjacent zones with maximum total habitat quality.

Approach

Given N habitat quality scores along a migration route, find maximum total score by selecting non-adjacent zones.

Input

5 50 35 70 45 80

Output

200
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