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 9417091

Browse files
SandersLinpoyea
authored andcommitted
Update sol1.py (TheAlgorithms#643)
small off by one error. Boundary condition: if len(number) =13 , we would need to check exactly 1 combination, namely number itself. However for i in range(len(number)-13): will iterate 0 times.
1 parent 60418a6 commit 9417091

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎project_euler/problem_08/sol1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
def main():
33
LargestProduct = -sys.maxsize-1
44
number=input().strip()
5-
for i in range(len(number)-13):
5+
for i in range(len(number)-12):
66
product=1
77
for j in range(13):
88
product *= int(number[i+j])

0 commit comments

Comments
(0)

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