Minimum Vulnerability of Non-Adjacent Servers

There are n servers arranged in order. Server i has vulnerability value vulnerability[i]. Select exactly k servers such that no two selected servers are adjacent.

The vulnerability of a selec...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: