Question
You are given a list of integers, each the net value of an optional task; values may be negative. You may complete any subset of the tasks, with one restriction: you can never complete two tasks that sit at adjacent positions in the list. Completing no tasks at all is allowed and scores 0. Return the maximum total value you can achieve. For example, [3, -2, 5] gives 8 by taking positions 0 and 2.
best_task_total(values: list[int]) → int[[3,-2,5]]out8[[-4,-1,-7]]out0State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.