Skip to main content
2 of 6
added 506 characters in body
DavidC
  • 25.4k
  • 2
  • 52
  • 105

#Mathematica 89 bytes

r@i_:=StringReplace[i,#->" "]&/@(Complement[y,#]&/@Subsequences[y=Characters@i])//Column

 

Explanation

i refers to the input string

Subsequences[y=Characters@i] returns all subsequences (represented as a list of characters) of the input.

For each subsequence, Complement... returns those characters from the input string that are not present. Each of those characters is replaced by an empty space via StringReplace[i,#->" "].

Column displays the results in a single column. Each result has the same number of characters, resulting in aligned letters.


r@"abcde"

output

DavidC
  • 25.4k
  • 2
  • 52
  • 105