Skip to content

Commit 18ae426

Browse files
committed
style: apply clang-format to CountSetBits files
1 parent 0c838e8 commit 18ae426

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/com/thealgorithms/bitmanipulation/CountSetBits.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ public static int countSetBits(int n) {
3131

3232
// Find the largest power of 2 <= n
3333
int x = largestPowerOf2InNumber(n);
34-
34+
3535
// Total bits at position x: x * 2^(x-1)
3636
int bitsAtPositionX = x * (1 << (x - 1));
37-
37+
3838
// Remaining numbers after 2^x
3939
int remainingNumbers = n - (1 << x) + 1;
40-
40+
4141
// Recursively count for the rest
4242
int rest = countSetBits(n - (1 << x));
43-
43+
4444
return bitsAtPositionX + remainingNumbers + rest;
4545
}
4646

0 commit comments

Comments
 (0)