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

R, 7575 72 bytes

function(s,x=tabulate(utf8ToInt(tolowery=utf8ToInt(s))%%32*(y>64),12226)[97:122])cat(x[!!x],sep="")

Try it online!Try it online!

Prints the result. For invalid input, prints nothing.

-3 bytes thanks to Dominic van Essen.

Test harness taken from pajonk's answer.

R, 75 bytes

function(s,x=tabulate(utf8ToInt(tolower(s)),122)[97:122])cat(x[!!x],sep="")

Try it online!

Prints the result. For invalid input, prints nothing.

Test harness taken from pajonk's answer.

R, 75 72 bytes

function(s,x=tabulate((y=utf8ToInt(s))%%32*(y>64),26))cat(x[!!x],sep="")

Try it online!

Prints the result. For invalid input, prints nothing.

-3 bytes thanks to Dominic van Essen.

Test harness taken from pajonk's answer.

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

R, 75 bytes

function(s,x=tabulate(utf8ToInt(tolower(s)),122)[97:122])cat(x[!!x],sep="")

Try it online!

Prints the result. For invalid input, prints nothing.

Test harness taken from pajonk's answer.