arjun has two strings s and t he can do following operation at most once
def excludeitem(item1, item2):
new_item = []
max = item1 if len(item1) > len(item2) else item2
min = item1 if len(item1) < len(item2) else item2
for i in max:
if i in min and i not in new_item:
new_item.append(i)
return new_item
print(excludeitem([1, 2, 2, 3], [7, 2, 5, 3, 3]))
Comments
Leave a comment