by AskAI

Solutions:

Check these solutions from our community and artificial intelligence:
This is a good solution. The sum function is the optimal solution because it is a built-in function that is already optimized.