Single Number (Leetcode 136)
Tag: Bit Manipulation
Problem Link: https://leetcode.com/problems/single-number/
class Solution:
def singleNumber(self, nums: List[int]) -> int:
xor=0
for i in nums:
xor=xor^i
return xor
PreviousPairs of Songs With Total Durations Divisible by 60 (Leetcode 1010)NextRotate Array (Leetcode 189)
Last updated