Code RoomEqual split point
EasyPrep Room Coding #478

Equal split point

CodingAlgorithms & data structuresEntry–Mid~11 min

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.

0:00 of about 11 min
InputExpectedGot
[[10,4,6,8,12]]truenot run yetsample