The CAT problem can be solved like this : (Python code)
s = "CAT"
op = []
def sub(s):
# terminating condition.
if (len(s) == 0) : return
if s not in op : op.append(s)
# slices from begning
sub(s[1:])
# slices from the end
sub(s[:-1])
sub(s)
print(op)