Advertisement
sweet1cris

Untitled

Jan 9th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class Solution {
  2.     public int singleNumber(int[] A) {
  3.         if(A == null || A.length == 0) {
  4.             return -1;
  5.         }
  6.         int rst = 0;
  7.         for (int i = 0; i < A.length; i++) {
  8.             rst ^= A[i];
  9.         }
  10.         return rst;
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement