Skip to content

Commit 9dc42bb

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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bit_manipulation/binary_parity_pattern.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
⚖️ Binary Parity Pattern
44
=======================================
55
6-
Generates a binary pattern where each bit represents
7-
the parity (even/odd) of the cumulative sum of bits
6+
Generates a binary pattern where each bit represents
7+
the parity (even/odd) of the cumulative sum of bits
88
in the original binary representation.
99
1010
Example:
1111
13 (1101) → cumulative sums [1,2,3,4]
1212
parity pattern = 1010
1313
"""
1414

15+
1516
def binary_parity_pattern(number: int) -> str:
1617
"""
1718
Generate parity pattern of cumulative binary sums.
@@ -39,4 +40,5 @@ def binary_parity_pattern(number: int) -> str:
3940

4041
if __name__ == "__main__":
4142
import doctest
43+
4244
doctest.testmod()

0 commit comments

Comments
 (0)