string subsequence in python code example
Example: subsequence python
def printSubSequences(STR, subSTR=""):
if len(STR) == 0:
print(subSTR, end=" ")
return
printSubSequences(STR[:-1], subSTR + STR[-1])
printSubSequences(STR[:-1], subSTR)
return
# Input : abc
# Output : a, b, c, ab, bc, ac, abc