Bit Manipulation: Lonely Integer

  • + 0 comments

    public class Solution {

    // Complete the findLonely function below.
    static int findLonely(List<Integer> arr) {
        int num=0;
       for(int i:arr){
           num=num^i;
       }return num;
    
    }