Skip to main content
Commonmark migration
Source Link

#Mathematica 89 bytes

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 lists of characters) of the input. (Subsequences was introduced in v. 10.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

#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 lists of characters) of the input. (Subsequences was introduced in v. 10.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

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 lists of characters) of the input. (Subsequences was introduced in v. 10.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

deleted 2 characters in body
Source Link
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 lists of characters) of the input. (Subsequences was introduced in v. 10.0.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

#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 lists of characters) of the input. (Subsequences was introduced in v. 10.0.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

#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 lists of characters) of the input. (Subsequences was introduced in v. 10.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

added 3 characters in body
Source Link
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 listlists of characters) of the input. (Subsequences was introduced in v. 10.0.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcde"r@"abcdefgh"

outputoutput

#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 output string has the same number of characters, resulting in aligned letters.


r@"abcde"

output

#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 lists of characters) of the input. (Subsequences was introduced in v. 10.0.4)

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 output string has the same number of characters, resulting in aligned letters.


r@"abcdefgh"

output

added 7 characters in body
Source Link
DavidC
  • 25.4k
  • 2
  • 52
  • 105
Loading
added 506 characters in body
Source Link
DavidC
  • 25.4k
  • 2
  • 52
  • 105
Loading
Source Link
DavidC
  • 25.4k
  • 2
  • 52
  • 105
Loading