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

added 372 characters in body
Source Link
xash
  • 11.3k
  • 1
  • 15
  • 39

J, 11 bytes

(".@|.":)~-

Try it online!

How it works

Uses @Bubbler's tacit trick for (F x) G (H y) = (G~F)~H.

(".@|.":)~-
 - negate y to shift right
( )~ flip arguments, so ((-y) ".@|. (":x))
 ": convert x to string
 |. shift that by negated y
 ".@ and convert back to number

J, 11 bytes

(".@|.":)~-

Try it online!

J, 11 bytes

(".@|.":)~-

Try it online!

How it works

Uses @Bubbler's tacit trick for (F x) G (H y) = (G~F)~H.

(".@|.":)~-
 - negate y to shift right
( )~ flip arguments, so ((-y) ".@|. (":x))
 ": convert x to string
 |. shift that by negated y
 ".@ and convert back to number
Source Link
xash
  • 11.3k
  • 1
  • 15
  • 39

J, 11 bytes

(".@|.":)~-

Try it online!

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