input: Write a python function to generate a random string of uppercase letters and digits of a given size.
  assert len(generate_random_string(8)) == 8
  assert len(generate_random_string(10)) == 10
  assert all(c.isupper() or c.isdigit() for c in generate_random_string(12))
output: import random
  import string
  
  def generate_random_string(size):
      characters = string.ascii_uppercase + string.digits
      return ''.join(random.choice(characters) for _ in range(size))