for combo in itertools.product((True, False), repeat=len(strInput) - 1):
    solution = []
for command, character in zip((False,) + combo, strInput):
    if command:
        solution[-1] += character
else:
    solution.append(character)
solution = [int(x) for x in solution]
if sum(solution) == correctOutput:
    pass
Как определить сумму группы целых чисел без использования рекурсии