Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Lines changed: 8 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /