input: from typing import List
  
  def fibonacci_series(n: int) -> List[int]:
      """ Generate and return a list of Fibonacci series up to the given number n.
      >>> fibonacci_series(5)
      [0, 1, 1, 2, 3]
      >>> fibonacci_series(10)
      [0, 1, 1, 2, 3, 5, 8]
      """
      if n < 0:
          return []
      elif n == 0:
          return [0]
      elif n == 1:
          return [0, 1]
      else:
          series = [0, 1]
          a, b = 0, 1
          while b <= n:
              c = a + b
              if c > n:
                  break
              series.append(c)
              a, b = b, c
          return series
output:     if n < 0:
          return []
      elif n == 0:
          return [0]
      elif n == 1:
          return [0, 1]
      else:
          series = [0, 1]
          a, b = 0, 1
          while b <= n:
              c = a + b
              if c > n:
                  break
              series.append(c)
              a, b = b, c
          return series