Skip to content
Snippets Groups Projects
Commit 46d4581a authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Solved 40

parent 5ce988fd
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
def multdigits(D):
answer = n = 1
start = 0
d = D.pop(0) - 1
while True:
ns = str(n)
end = start + len(ns)
while start <= d < end:
answer *= int(ns[d - start])
if not len(D):
return answer
d = D.pop(0) - 1
start = end
n += 1
return answer
print multdigits([10 ** e for e in range(7)])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment