Code Room
CodingMediumcod-g1473
Subject Dynamic programming 1dLevel Entry–Mid~12 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You are driving a long highway with food stalls in a fixed order, and a review app shows each stall's taste score (a positive integer). If you stop at a stall you will be too full to stop at the very next one, so you can never visit two consecutive stalls. Given the list of scores in road order, return the maximum total taste score you can collect over the whole trip. An empty list returns 0.

Implement
max_stall_score(scores: list[int]) → int
Examples
in[[4,9,6,3,8]]out18
in[[2,7,9,3,1]]out12
What a strong answer looks like

State 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.

Run or narrate your approach, then ask the coach.