Skip to main content
deleted 1 character in body
Source Link
Maël
  • 419
  • 2
  • 9

R, 9089 bytes

\(x,y)Reduce(paste0,sapply(el(strsplit(x,"")),\(z)cwhmisc::int2B(grep(z, letters),y))[1,])

With R < 4.1, \ needs to be replaced with function resulting in a total of 104 bytes.

-5 bytes thanks to @pajonk.

Try it online!

R, 90 bytes

\(x,y)Reduce(paste0,sapply(el(strsplit(x,"")),\(z)cwhmisc::int2B(grep(z, letters),y))[1,])

With R < 4.1, \ needs to be replaced with function resulting in a total of 104 bytes.

-5 bytes thanks to @pajonk.

Try it online!

R, 89 bytes

\(x,y)Reduce(paste0,sapply(el(strsplit(x,"")),\(z)cwhmisc::int2B(grep(z,letters),y))[1,])

With R < 4.1, \ needs to be replaced with function resulting in a total of 104 bytes.

-5 bytes thanks to @pajonk.

Try it online!

added 315 characters in body
Source Link
Maël
  • 419
  • 2
  • 9

RR, 9590 bytes

\(x,y)pasteReduce(paste0,sapply(el(strsplit(x,"")[[1]]),\(z)cwhmisc::int2B(grep(z, letters),y))[1,],collapse="")

With R < 4.1, \ needs to be replaced with function resulting in a total of 104 bytes.

-5 bytes thanks to @pajonk.

Try it online!

R, 95 bytes

\(x,y)paste(sapply(strsplit(x,"")[[1]],\(z)cwhmisc::int2B(grep(z, letters),y))[1,],collapse="")

R, 90 bytes

\(x,y)Reduce(paste0,sapply(el(strsplit(x,"")),\(z)cwhmisc::int2B(grep(z, letters),y))[1,])

With R < 4.1, \ needs to be replaced with function resulting in a total of 104 bytes.

-5 bytes thanks to @pajonk.

Try it online!

deleted 9 characters in body
Source Link
Maël
  • 419
  • 2
  • 9

R, 10395 bytes

library(cwhmisc);\\(x,y)paste(sapply(strsplit(x,"")[[1]],\(z)cwhmisc::int2B(grep(z, letters),y))[1,],collapse="")

R, 103 bytes

library(cwhmisc);\(x,y)paste(sapply(strsplit(x,"")[[1]],\(z)int2B(grep(z, letters),y))[1,],collapse="")

R, 95 bytes

\(x,y)paste(sapply(strsplit(x,"")[[1]],\(z)cwhmisc::int2B(grep(z, letters),y))[1,],collapse="")
Source Link
Maël
  • 419
  • 2
  • 9
Loading