Python/project_euler/problem_08/sol2.py
Sanders Lin 60418a6fd7 Create project Euler problem 8 sol2.py (#644)
intuitive solution using functional programming
2019-02-13 14:55:48 +08:00

9 lines
210 B
Python

from functools import reduce
def main():
number=input().strip()
print(max([reduce(lambda x,y: int(x)*int(y),number[i:i+13]) for i in range(len(number)-12)]))
if __name__ == '__main__':
main()