def build(size): return [None] * size def my_len(values): values = list(values) size = 0 while True: current = build(size) if str(current) == str(values): return size values[size] = None size += 1