#sample solution
listOfNums = [1,2,3,4,3,1,2]
def remove_duplicates(listOfNums):
listOfNums.sort()
uniqueList = [1]
uniqueList[0] = listOfNums[0]
index=0
for num in listOfNums:
if uniqueList[index] != num:
uniqueList.append(num)
index = index + 1
return uniqueList
print remove_duplicates(listOfNums)
No comments:
Post a Comment