Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

An advertising layout consists of two vertical columns, each with a total height equal to the sum of the advertisements placed in it. You are given an integer array heights, where heights[i] is the height of the ith advertisement.

Advertisements are considered from left to right in heights. Each advertisement belongs to the column whose total height is smaller at that time. If both columns have the same total height, it belongs to the left column. Both columns are initially empty.

Test Cases
Input
Output
Expected