input: def max_triangle_height(red: int, blue: int) -> int:
      """
      Given two integers representing counts of red and blue colored balls, determine the tallest possible triangle that can be formed under the condition that each row has uniform color balls and adjacent rows have different colored balls. The 1st row should have 1 ball, the 2nd row 2 balls, the 3rd row 3 balls, and so on.
  
      Return the greatest height of the triangle achievable.
  
      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, assume starting with blue
              if blue >= height + 1:
                  blue -= (height + 1)
                  height += 1
              else:
                  break
          else:  # Odd row, assume starting with red
              if red >= height + 1:
                  red -= (height + 1)
                  height += 1
              else:
                  break
      return height