Skip to content

Commit 1424515

Browse files
committed
Fix
1 parent eec23bb commit 1424515

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
package com.thealgorithms.bitmanipulation;
22

3-
public class HammingDistance {
3+
/**
4+
* The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
5+
* Given two integers x and y, calculate the Hamming distance.
6+
* Example:
7+
* Input: x = 1, y = 4
8+
* Output: 2
9+
* Explanation: 1 (0001) and 4 (0100) have 2 differing bits.
10+
*
11+
* @author Hardvan
12+
*/
13+
public final class HammingDistance {
14+
private HammingDistance() {
15+
}
416

517
/**
618
* Calculates the Hamming distance between two integers.

0 commit comments

Comments
 (0)