However, it finished outside of the time limit :(
Hello all, this is my first post here.
I am using the list comprehension.
def singleNonDuplicate(self, nums):
return [nums[i] for i in range(len(nums)) if nums.count(nums[i]) < 2]
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.