Code Room
CodingEasycod-g1292
Subject Prefix sumLevel Entry–Mid~11 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Two teammates agree to split a chronological list of project expenses: the first pays every expense up to some cut point, the second pays everything after it. Both parts must be non-empty and must total the same amount. Given the expense amounts in order (values may be negative for refunds), return True if such a cut point exists and False otherwise. Example: costs = [10, 4, 6, 8, 12] gives True — cut after the third expense: 10 + 4 + 6 = 8 + 12 = 20.

Implement
can_split_evenly(costs: list[int]) → bool
Examples
in[[10,4,6,8,12]]outtrue
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.