Skip to content

Commit 07d9413

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent af1c6d8 commit 07d9413

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

divide_and_conquer/karatsuba_multiplication.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
0
2929
"""
3030

31+
3132
def karatsuba_multiply(x: str, y: str) -> int:
3233
"""
3334
Multiplies two binary strings using the Karatsuba algorithm.
@@ -62,7 +63,7 @@ def karatsuba_multiply(x: str, y: str) -> int:
6263
p2 = karatsuba_multiply(x_right, y_right)
6364
p3 = karatsuba_multiply(
6465
bin(int(x_left, 2) + int(x_right, 2))[2:],
65-
bin(int(y_left, 2) + int(y_right, 2))[2:]
66+
bin(int(y_left, 2) + int(y_right, 2))[2:],
6667
)
6768

6869
# Karatsuba combination formula:
@@ -73,4 +74,5 @@ def karatsuba_multiply(x: str, y: str) -> int:
7374

7475
if __name__ == "__main__":
7576
import doctest
77+
7678
doctest.testmod()

0 commit comments

Comments
 (0)