Visit Array Positions to Maximize Score
Each move forward adds a value and pays a penalty when the parity changes, so the best score at each position comes from its best earlier position.
Each move forward adds a value and pays a penalty when the parity changes, so the best score at each position comes from its best earlier position.