input: def calculate_triangle_height(red: int, blue: int) -> int:
      """
      Given two integers red and blue, denoting the quantities of red and blue balls respectively, you need to create a triangle where:
      - The 1st row contains 1 ball
      - The 2nd row contains 2 balls
      - The 3rd row contains 3 balls, and so on.
  
      Each row must be made up of balls of a single color, and consecutive rows must be of different colors.
  
      The function should return the maximum possible height of the triangle.
  
      Examples:
      >>> red = 2, blue = 4
      3
      >>> red = 2, blue = 1
      2
  
      Constraints:
      1 <= red, blue <= 100
      """
output:     
      total_balls = red + blue
      height = 0
      while total_balls >= (height + 1):
          height += 1
          total_balls -= height
  
          if height % 2 == 1:
              red -= height
          else:
              blue -= height
  
          if red < 0 or blue < 0:
              height -= 1
              break
  
      return height
  