excelent solution, but recursion in this case can lead to RecursionError: maximum recursion depth exceeded in comparison in very rare cases.
I propose add test cases with 3 spaces, and 4, 5 spaces between words. Almost all solutions do not save 3 spaces between words.
Becuase it test case present not bool values. Try this code sum([True, None]) and you will get TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
sum([True, None])
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
Loading collection data...
excelent solution, but recursion in this case can lead to RecursionError: maximum recursion depth exceeded in comparison in very rare cases.
I propose add test cases with 3 spaces, and 4, 5 spaces between words. Almost all solutions do not save 3 spaces between words.
Becuase it test case present not bool values. Try this code
sum([True, None])
and you will getTypeError: unsupported operand type(s) for +: 'int' and 'NoneType'