Skip to main content
Commonmark migration
Source Link

#Stax, 9 bytes

Stax, 9 bytes

ü◘ø⌠Δ>0↔å 

Port of my MathGolf answer. This is only my second Stax answer, so there might be a shorter alternative.

Try it online or try it online unpacked (10 bytes).

Explanation (of the unpacked version):

0 # Start at 0 w # While true without popping, by using everything else as block: x+ # Add the input-integer c # Duplicate the top of the stack E # Convert it to a list of digits |M # Get the maximum of this list 1> # And check that it's larger than 1 # (after the while, the top of the stack is output implicitly as result) 

#Stax, 9 bytes

ü◘ø⌠Δ>0↔å 

Port of my MathGolf answer. This is only my second Stax answer, so there might be a shorter alternative.

Try it online or try it online unpacked (10 bytes).

Explanation (of the unpacked version):

0 # Start at 0 w # While true without popping, by using everything else as block: x+ # Add the input-integer c # Duplicate the top of the stack E # Convert it to a list of digits |M # Get the maximum of this list 1> # And check that it's larger than 1 # (after the while, the top of the stack is output implicitly as result) 

Stax, 9 bytes

ü◘ø⌠Δ>0↔å 

Port of my MathGolf answer. This is only my second Stax answer, so there might be a shorter alternative.

Try it online or try it online unpacked (10 bytes).

Explanation (of the unpacked version):

0 # Start at 0 w # While true without popping, by using everything else as block: x+ # Add the input-integer c # Duplicate the top of the stack E # Convert it to a list of digits |M # Get the maximum of this list 1> # And check that it's larger than 1 # (after the while, the top of the stack is output implicitly as result) 
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#Stax, 9 bytes

ü◘ø⌠Δ>0↔å 

Port of my MathGolf answer. This is only my second Stax answer, so there might be a shorter alternative.

Try it online or try it online unpacked (10 bytes).

Explanation (of the unpacked version):

0 # Start at 0 w # While true without popping, by using everything else as block: x+ # Add the input-integer c # Duplicate the top of the stack E # Convert it to a list of digits |M # Get the maximum of this list 1> # And check that it's larger than 1 # (after the while, the top of the stack is output implicitly as result)