非繰り返し数の配列を探します

@Test
     公共 ボイド試験(){
         int型 [] = {1、2、3、2、1、3、4、4、6 }。
        System.out.println(singleNumber(a)参照)。


    } 
    公共 INT singleNumber(INT [] A){
         場合(A == NULL || A.length == 0 ){
             リターン -1 
        } 
        INT RST = 0 以下のためにINT iが= 0; I <A.length; I ++ ){ 
            RST ^ = A [i]は、
        } 
        戻りRST。
    }

 

おすすめ

転載: www.cnblogs.com/fanBlog/p/12177370.html
おすすめ