project_euler.problem_013.sol2

Problem 13: https://projecteuler.net/problem=13

Problem Statement: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.

Functions

solution(→ str)

Returns the first 'n' digits of the sum of the array elements

Module Contents

project_euler.problem_013.sol2.solution(n: int = 10) str

Returns the first ‘n’ digits of the sum of the array elements from the file num.txt. n should be larger than 2.

>>> solution(3)
'553'
>>> solution(6)
'553737'