Skip to content

Commit 6a5aa93

Browse files
authored
Merge pull request #314 from sir-gon/develop
[REFACTOR] [Hacker Rank]: Project Euler #1: Multiples of 3 and 5. Cle…
2 parents 4ffd69a + 2bb1a0d commit 6a5aa93

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hackerrank/projecteuler/euler001.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
# Function to find sum of Arithmetic Progression series
8-
def sum_ap(n: int, d: int):
8+
def sum_of_arithmetic_progression(n: int, d: int):
99

1010
# Number of terms
1111
n = n//d
@@ -20,6 +20,6 @@ def euler001(a, b, n):
2020
n = n-1
2121
lcm = (a*b)//math.gcd(a, b)
2222

23-
return sum_ap(n, a) + \
24-
sum_ap(n, b) - \
25-
sum_ap(n, lcm)
23+
return sum_of_arithmetic_progression(n, a) + \
24+
sum_of_arithmetic_progression(n, b) - \
25+
sum_of_arithmetic_progression(n, lcm)

0 commit comments

Comments
 (0)