#=================================== # Tanzila Islam # Email: tanzilamohita@gmail.com # Language: Python 3 #=================================== class Solution: def singleNumber(self, nums: List[int]) -> int: if len(nums) == 1: return (nums[0]) elif len(nums) != 0: res = 0 for i in range(len(nums)): res ^= nums[i] return res
No comments:
Post a Comment