input: from typing import List
  
  
  def matching_paren(s: str) -> bool:
      """ Check if a given string has matching parentheses.
      >>> matching_paren("()")
      True
      >>> matching_paren("(()()())")
      True
      >>> matching_paren("((()")
      False
      >>> matching_paren("())(")
      False
      >>> matching_paren("")
      True
      """
output:     stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if not stack or stack.pop() != '(':
                  return False
      return len(stack) == 0