Ad
  • Custom User Avatar

    I didn't know the python limtation. My code passes with simple casting with int(). Although I wanted to know maximum length of blocks by this algorithm ,is 4300 digits

    Sum digit by digit: 0.454667329788208 seconds
    Sum in blocks of 100: 0.02377772331237793 seconds
    Sum in blocks of 1000: 0.030898571014404297 seconds
    Sum in blocks of 4300: 0.09897232055664062 seconds

    ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 4301 digits; use sys.set_int_max_str_digits() to increase the limit