Loading...
Engaged Employer
How to remove duplicated items in a list? What's the complexity of your algorithm?
Anonymous
def rem_dupe(input_list): x = set(input_list) return [y for y in x]
def remove_duplicates(arr): return list(dict.fromkeys(arr).keys())
def remove_duplicate(l): ...: res = [] ...: n = len(l) ...: if n < 2: ...: return l ...: for i in range(1,n): ...: if l[i-1] != l[i]: ...: res.append(l[i-1]) ...: res.append(l[-1]) ...: return res
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.