Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.
Difficulty:Easy
class Solution(object):
def containsDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
nums.sort()
leng = len(nums)
i = 0
while i<leng:
if(i>0) and nums[i]==nums[i-1]:
return True
i = i+1
return False