mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Update sol1.py (#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.
This commit is contained in:
parent
60418a6fd7
commit
9417091dab
|
@ -2,7 +2,7 @@ import sys
|
||||||
def main():
|
def main():
|
||||||
LargestProduct = -sys.maxsize-1
|
LargestProduct = -sys.maxsize-1
|
||||||
number=input().strip()
|
number=input().strip()
|
||||||
for i in range(len(number)-13):
|
for i in range(len(number)-12):
|
||||||
product=1
|
product=1
|
||||||
for j in range(13):
|
for j in range(13):
|
||||||
product *= int(number[i+j])
|
product *= int(number[i+j])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user