code: def all_the_same(pointer, length, id_list):
      
      element = id_list[pointer]
      pointer += 1
      while pointer < length:
          if element != id_list[pointer]:
              return -1
          pointer += 1
      return element
docs: :param pointer: starting from that element the list is being checked for equality of its elements
      :param length:
      :param id_list: List mustn't be empty or Null. There has to be at least one element
      :return: returns the first encountered element if starting from the pointer all elements are the same,
       otherwise it returns -1