how to find contiguous substrings from a string in python,"['a', 'b', 'c', 'cc', 'd', 'dd', 'ddd', 'c', 'cc', 'e']"