Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
給定一個整數數組,每個元素出現三次,除了一個,它只出現一次。 找到這單獨的一個。
注意:
您的算法應具有線性運行時復雜性。 你能實現它,而不使用額外的內存。
設置mask用來比對每一位上的數是否出現多余1,一步步還原只有一個的那個數。
新聞熱點
疑難解答
圖片精選