Add find non repeating number algorithm (#4328)

This commit is contained in:
Bama Charan Chhandogi
2023-08-24 23:06:12 +05:30
committed by GitHub
parent 52f365a915
commit b4f786369b
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,17 @@
package com.thealgorithms.bitmanipulation;
/**
* Find Non Repeating Number
* @author Bama Charan Chhandogi (https://github.com/BamaCharanChhandogi)
*/
public class NonRepeatingNumberFinder {
public static int findNonRepeatingNumber(int[] arr) {
int result = 0;
for (int num : arr) {
result ^= num;
}
return result;
}
}