Skip to content

Commit 60418a6

Browse files
SandersLinpoyea
authored andcommitted
Create project Euler problem 8 sol2.py (TheAlgorithms#644)
intuitive solution using functional programming
1 parent 02155de commit 60418a6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

project_euler/problem_08/sol2.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from functools import reduce
2+
3+
def main():
4+
number=input().strip()
5+
print(max([reduce(lambda x,y: int(x)*int(y),number[i:i+13]) for i in range(len(number)-12)]))
6+
7+
if __name__ == '__main__':
8+
main()

0 commit comments

Comments
 (0)