Pergunta de entrevista da empresa ENSO

Write a function to return a list of all subsequences of a string in sorted order, excluding the empty string.

Resposta da entrevista

Sigiloso

9 de nov. de 2016

from itertools import combinations def build_subsequences(s): return sorted(''.join(ss) for i in range(1, len(s)+1) for ss in combinations(s, i))