input: def triangle_max_height(red: int, blue: int) -> int:
      """
      Suppose you have two integers representing the number of red and blue balls. Arrange these balls to create a triangle where the 1st row has 1 ball, the 2nd row has 2 balls, and so on. Each row should be the same color and adjacent rows should be different colors.
  
      Determine the maximum possible height of this triangle.
  
      Examples:
      >>> red = 2, blue = 4
      3
      >>> red = 2, blue = 1
      2
  
      Constraints:
      1 <= red, blue <= 100
      """
output:     
      height = 0
      while True:
          if height % 2 == 0:  # Even row, looking to use red balls
              if red >= height + 1:
                  red -= height + 1
                  height += 1
              else:
                  break
          else:  # Odd row, looking to use blue balls
              if blue >= height + 1:
                  blue -= height + 1
                  height += 1
              else:
                  break
      return height
  