Question: Can someone explain the time complexity of this program trying to remove duplicates from a collection def removeDup(l1): print(Before,l1) l2=[] #create second list that will
Can someone explain the time complexity of this program trying to remove duplicates from a collection
def removeDup(l1): print("Before",l1) l2=[] #create second list that will be returned to the collection for i in l1: #go through items if i not in l2: #if the item not in list already add to l2 l2.append(i) return l2 print(removeDup([4,5,9,7,8,2,4,8,5,1,5,7,1,8,4]))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
