You are given two integers red and blue, representing the count of red and blue balls available.
You want to build a triangle of balls to achieve the maximum possible height subject to the following conditions:
The
Every ball in a single row must share the same color.
Consecutive rows must alternate in color.
Return the maximum height of a triangle that can be constructed.
Constraints:
red, blue
You are given two integers red and blue, representing the count of red and blue balls available.
You want to build a triangle of balls to achieve the maximum possible height subject to the following conditions:
The
Every ball in a single row must share the same color.
Consecutive rows must alternate in color.
Return the maximum height of a triangle that can be constructed.
Constraints:
red, blue