mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00:00
Create project Euler problem 8 sol2.py (#644)
intuitive solution using functional programming
This commit is contained in:
parent
02155def00
commit
60418a6fd7
8
project_euler/problem_08/sol2.py
Normal file
8
project_euler/problem_08/sol2.py
Normal file
|
@ -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()
|
Loading…
Reference in New Issue
Block a user