Search
⌘K

Leetcode 3200. Maximum Height of a Triangle

Find the largest height h such that rows 1..h (row i has i balls) can be colored alternately with one color per row without exceeding the given red and blue counts; equivalently, for each h check whether the total T = h(h+1)/2 can be split into the alternating (odd/even index) row sums to fit red and blue (try both starting colors).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.