Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 6 characters in body
Source Link
digEmAll
  • 5.1k
  • 15
  • 22

R, 116 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i)intToUtf8(`[<-`(u,u>45,i)))

Try it online!

Function returning a vector of newline separated switchboardsboards

R, 116 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i)intToUtf8(`[<-`(u,u>45,i)))

Try it online!

Function returning a vector of newline separated switchboards

R, 116 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i)intToUtf8(`[<-`(u,u>45,i)))

Try it online!

Function returning a vector of newline separated boards

deleted 9 characters in body
Source Link
digEmAll
  • 5.1k
  • 15
  • 22

R, 118116 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i,r=u){r[r>45]=i;intToUtf8intToUtf8(r`[<-`(u,u>45,i)}))

Try it online! Try it online!

Function returning a vector of newline separated switchboards

R, 118 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i,r=u){r[r>45]=i;intToUtf8(r)})

Try it online!

Function returning a vector of newline separated switchboards

R, 116 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i)intToUtf8(`[<-`(u,u>45,i)))

Try it online!

Function returning a vector of newline separated switchboards

Source Link
digEmAll
  • 5.1k
  • 15
  • 22

R, 118 bytes

function(x,u=utf8ToInt(x))apply(expand.grid(rep(list(c(118,94)),sum(u>45))),1,function(i,r=u){r[r>45]=i;intToUtf8(r)})

Try it online!

Function returning a vector of newline separated switchboards

AltStyle によって変換されたページ (->オリジナル) /