Skip to content

Commit

Permalink
Create project Euler problem 8 sol2.py (TheAlgorithms#644)
Browse files Browse the repository at this point in the history
intuitive solution using functional programming
  • Loading branch information
SandersLin authored and poyea committed Feb 13, 2019
1 parent 02155de commit 60418a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions project_euler/problem_08/sol2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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()

0 comments on commit 60418a6

Please sign in to comment.