Pergunta de entrevista da empresa Nokia

Print all possible combinations of string from a given sentence, with output string length fixed and no duplicates.