Skip to content

Commit 05280ab

Browse files
authored
Update FindNthBit.java
1 parent 4242f28 commit 05280ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public static int findNthBit(int num, int n) {
4141
throw new IllegalArgumentException("Bit position must be greater than or equal to 1.");
4242
}
4343
// Shifting the number to the right by (n - 1) positions and checking the last bit
44-
return ((num & (1 << (n - 1))) >> (n - 1));
44+
return (num & (1 << (n - 1))) >> (n - 1);
4545
}
4646
}

0 commit comments

Comments
 (0)