Skip to content

Commit ca5c6f2

Browse files
author
Christian Bender
authored
Merge pull request TheAlgorithms#292 from TheAlgorithms/fixed_solv_4_problem1
fixed solution 4 of problem 1
2 parents 2c0de39 + 10b0a40 commit ca5c6f2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Project Euler/Problem 01/sol4.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def mulitples(limit):
99
if (result < limit):
1010
zmulti.append(result)
1111
temp += 1
12-
continue
1312
else:
1413
temp = 1
1514
break
@@ -18,15 +17,14 @@ def mulitples(limit):
1817
if (result < limit):
1918
xmulti.append(result)
2019
temp += 1
21-
continue
2220
else:
23-
temp = 1
2421
break
25-
return (sum(zmulti) + sum(xmulti))
22+
collection = list(set(xmulti+zmulti))
23+
return (sum(collection))
2624

2725

2826

2927

3028

3129

32-
print (mulitples(100))
30+
print (mulitples(1000))

0 commit comments

Comments
 (0)