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 613 characters in body; added 89 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 14 bytes

DUz0«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

A monadic link taking a list of two integers as its argument and returning an integer.

Explanation

D | Decimal digits
 U | Reverse order of each set of digits
 z0 | Transpose with 0 as filler
 Ɗ€ | For each pair of digits, do the following as a monad:
 « Ɗ | - Minimum of the two digits and the following as a monad (vectorises):
 9_ | - 9 minus the digits
 Ṛ | - Reverse the order
 Ṁ | - Maximum
 U | Reverse the order of the answer to restore the orignal order of digits
 Ḍ | Convert back from decimal digits to integer

If a digit matrix is acceptable input/output:

Jelly, 12 bytes

Uz0«9_ṚƊṀƊ€U

Try it online!

Jelly, 14 bytes

DUz0«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 12 bytes

Uz0«9_ṚƊṀƊ€U

Try it online!

Jelly, 14 bytes

DUz0«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

A monadic link taking a list of two integers as its argument and returning an integer.

Explanation

D | Decimal digits
 U | Reverse order of each set of digits
 z0 | Transpose with 0 as filler
 Ɗ€ | For each pair of digits, do the following as a monad:
 « Ɗ | - Minimum of the two digits and the following as a monad (vectorises):
 9_ | - 9 minus the digits
 Ṛ | - Reverse the order
 Ṁ | - Maximum
 U | Reverse the order of the answer to restore the orignal order of digits
 Ḍ | Convert back from decimal digits to integer

If a digit matrix is acceptable input/output:

Jelly, 12 bytes

Uz0«9_ṚƊṀƊ€U

Try it online!

deleted 9 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 1314 bytes

DUZ«9_ṚƊṀƊ€UḌDUz0«9_ṚƊṀƊ€UḌ

Try it online! Try it online!

Grid of all single digit pairs Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 1112 bytes

UZ«9_ṚƊṀƊ€UUz0«9_ṚƊṀƊ€U

Try it online! Try it online!

Jelly, 13 bytes

DUZ«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 11 bytes

UZ«9_ṚƊṀƊ€U

Try it online!

Jelly, 14 bytes

DUz0«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 12 bytes

Uz0«9_ṚƊṀƊ€U

Try it online!

Post Undeleted by Nick Kennedy
added 35 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 913 bytes

D9_Ṛ«Ʋ»/ḌDUZ«9_ṚƊṀƊ€UḌ

Try it online! Try it online!

Grid of all single digit pairs Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 711 bytes

9_Ṛ«Ʋ»/UZ«9_ṚƊṀƊ€U

Try it online! Try it online!

Jelly, 9 bytes

D9_Ṛ«Ʋ»/Ḍ

Try it online!

Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 7 bytes

9_Ṛ«Ʋ»/

Try it online!

Jelly, 13 bytes

DUZ«9_ṚƊṀƊ€UḌ

Try it online!

Grid of all single digit pairs

If a digit matrix is acceptable input/output:

Jelly, 11 bytes

UZ«9_ṚƊṀƊ€U

Try it online!

Post Deleted by Nick Kennedy
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44
Loading

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