input: Write a python function to generate a checkerboard pattern of a given size.
  assert checkerboard_pattern(7) == "#######\n # # # \n#######\n # # # \n#######\n # # # \n#######\n"
  assert checkerboard_pattern(3) == "###\n # \n###\n"
  assert checkerboard_pattern(4) == "####\n # #\n####\n # #\n"
output: def checkerboard_pattern(size):
      pattern = []
      for i in range(size):
          if i % 2 == 0:
              pattern.append("#" * size)
          else:
              pattern.append(" " + "# " * (size // 2) + " "[:size % 2])
      return "\n".join(pattern) + "\n"