Commit 46d4581a authored by Taddeus Kroes's avatar Taddeus Kroes

Solved 40

parent 5ce988fd
#!/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)])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment