Skip to content

Commit a91ff20

Browse files
Update maths/combinations.py
1 parent ec2491c commit a91ff20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

maths/combinations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def combinations(n: int, k: int) -> int:
3636
raise ValueError("Please enter positive integers for n and k where n >= k")
3737
res = 1
3838
for i in range(k):
39-
res = res * (n - i)
40-
res = res // (i + 1)
39+
res *= (n - i)
40+
res //= (i + 1)
4141
return res
4242

4343

0 commit comments

Comments
 (0)