Question bank › Dynamic Programming
Dsa Dynamic Programming Easy

Company Performance Optimization

You are evaluating the quarterly performance of your company, assessing profit changes over several quarters. The performance in each quarter can either increase or decrease, represented by positive and negative values respectively. To maximize profit over a specific period, you can choose to omit up to one quarter from consideration. Given the list of quarterly performances, calculate the maximum possible total performance by optionally omitting one quarter. Input format: - The first line contains an integer n (1 ≤ n ≤ 100), the number of quarters. - The second line contains n integers representing the quarterly performances. Output format: - Output a single integer, the maximum total performance that can be achieved. Example: Input: 5 4 -1 2 1 -3 Output: 6

Key concepts

dynamic_programmingarraygreedy

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.