I have a list of characters:
groups = ['a', 'e', 'i', 'o', 'u']
And I have a list of words:
strings = ['testing', 'tested', 'fisherman', 'sandals', 'name']
I need to split the words based on the characters mentioned in the groups list. The word "tested" can be grouped as "t + est + ed"
Select the last group. So 'ed' in this case should be selected and only 'd' returned, because 'e' is already known.
expected={'testing':'ng', 'tested':'d', 'fisherman':'n', 'sandals':'ls', 'name':''}
If there is only 'e' then I can write:
'tested'.split('e')[-1]
But not sure how to check other characters.