l = ['abbb', 'xc', 'abb', 'abed', 'sdfdg', 'xc', 'abfdsdg', 'xccc', 'd',
    'dd', 'sdfdg', 'xc', 'abfdsdg', 'xccc', 'd', 'dd']

def find_with_dupe(l):
    d = defaultdict(list)
srt = sorted(set(l))
ind = len(srt[0])
for ele in srt:
    d[ele[:ind]].append(ele)
for val in list(d.values()):
    for v in val:
        if not any(v.startswith(s) and v != s for s in val):
            yield v
print(list(find_with_dupe(l)))
['abfdsdg', 'abed', 'abb', 'd', 'sdfdg', 'xc']
Obtain a list containing string elements excluding elements prefixed with any other element from initial list