input: Write a function to create an array with given capacity and add items to it, resizing when necessary.
  assert array_test() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  
  def array_test():
      arr = Array(10)
      for i in range(1, 13):
          arr.add(i)
      return arr.items[:arr.size]
output: class Array:
      def __init__(self, capacity):
          self.capacity = capacity
          self.size = 0
          self.items = [None] * capacity
  
      def add(self, item):
          if self.size == self.capacity:
              self._resize()
          self.items[self.size] = item
          self.size += 1
  
      def _resize(self):
          self.capacity *= 2
          new_items = [None] * self.capacity
          for i in range(self.size):
              new_items[i] = self.items[i]
          self.items = new_items
  
  def array_test():
      arr = Array(10)
      for i in range(1, 13):
          arr.add(i)
      return arr.items[:arr.size]