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

44
Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 5044 bytes

eval`-`=seq;eval(parse(t=c("c(",gsub("-",":",scan(,'')""),")")))

Try it online! Try it online!

Replace allRedefine - withto mean seq (i.e. :), surround the input with c() and evaluate the corresponding expression.

R, 50 bytes

eval(parse(t=c("c(",gsub("-",":",scan(,'')),")")))

Try it online!

Replace all - with :, surround with c() and evaluate the corresponding expression.

R, 44 bytes

`-`=seq;eval(parse(t=c("c(",scan(,""),")")))

Try it online!

Redefine - to mean seq (i.e. :), surround the input with c() and evaluate the corresponding expression.

Source Link
Robin Ryder
  • 15.8k
  • 2
  • 25
  • 71

R, 50 bytes

eval(parse(t=c("c(",gsub("-",":",scan(,'')),")")))

Try it online!

Replace all - with :, surround with c() and evaluate the corresponding expression.

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