Skip to content

Instantly share code, notes, and snippets.

@wiccy46
Created May 2, 2020 20:45
Show Gist options
  • Save wiccy46/4e0191401440cdad7ac93faa126bacba to your computer and use it in GitHub Desktop.
Save wiccy46/4e0191401440cdad7ac93faa126bacba to your computer and use it in GitHub Desktop.
[subsequence] subsequence of a string using combinations #python
from itertools import combinations
s = 'abcdef'
set(''.join(c) for i in range(len(s) + 1) for c in combinations(s, i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment