input: Write a function to generate a two-dimensional array filled with zeros based on the given number of rows and columns. The function should return the generated array. If the number of rows or columns is zero, return a 1-dimensional array with a single 0.
  assert generate_zeros_array(3, 3)==[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
  assert generate_zeros_array(2, 4)==[[0, 0, 0, 0], [0, 0, 0, 0]]
  assert generate_zeros_array(1, 1)==[[0]]
  assert generate_zeros_array(0, 5)==[0]
  assert generate_zeros_array(5, 0)==[0]
output: def generate_zeros_array(rows, cols):
      if rows == 0 or cols == 0:
          return [0]
      return [[0] * cols for _ in range(rows)]