Skip to main content
added 21 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 159 134134 125 bytes

icuSetCollate(locale="ASCII");K=chartr;K;s=scan(A,N,sort"");s[order(Kchartr(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-"A-Za-z",scan(,""))s))]

Try it online!Try it online!

Thanks to Dominic van Essen for -7 bytes.

Similar to others, translate the characters in the string using chartr into an appropriate orderorder, then translate backsort the strings using that order.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

R, 159 134 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-"A-Za-z",scan(,""))))

Try it online!

Thanks to Dominic van Essen for -7 bytes.

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

R, 159 134 125 bytes

icuSetCollate(locale="ASCII");s=scan(,"");s[order(chartr("CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw","A-Za-z",s))]

Try it online!

Thanks to Dominic van Essen for -7 bytes.

Similar to others, translate the characters in the string using chartr into an appropriate order, then sort the strings using that order.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

added 51 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 159159 134 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-Reduce(paste0,c(LETTERS,letters))"A-Za-z",scan(,""))))

Try it online!Try it online!

Thanks to Dominic van Essen for -7 bytes.

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

R, 159 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-Reduce(paste0,c(LETTERS,letters)),scan(,""))))

Try it online!

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

R, 159 134 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-"A-Za-z",scan(,""))))

Try it online!

Thanks to Dominic van Essen for -7 bytes.

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

added 19 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 159 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-Reduce(paste0,c(LETTERS,letters)),scan(,""))))

Try it online!

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

R, 159 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-Reduce(paste0,c(LETTERS,letters)),scan(,""))))

Try it online!

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in R, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin"). So I switch to an ASCII locale.

R, 159 bytes

icuSetCollate(locale="ASCII");K=chartr;K(A,N,sort(K(N<-"CcJOoSsUabDdefGghjLlnPpQqrTtuVvXxyABFHIiKkNRYZzEMmWw",A<-Reduce(paste0,c(LETTERS,letters)),scan(,""))))

Try it online!

Similar to others, translate the characters in the string using chartr into an appropriate order, then translate back.

The default collation order in the R install on TIO, en_US.UTF8, is very odd: while, for instance, e comes before E, ekF comes after EgHTk (those being the translations of "and" and "begin" in the unchanged test case). So I switch to an ASCII locale, which compares by byte value instead.

Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105
Loading