Skip to main content
added 55 characters in body
Source Link

perl -apple, 18 bytes

$F[0]&&chop;$_%=10

Try it online!

Prints the last digit of n for the special sequence (c = 0), otherwise, the penultimate digit of n. Perls DWIM magically makes itIt doesn't quite work for single digit inputs. ("" % 10 equals 0n)'s, but since we only have to tend towards equal distribution, it doesn't matter what it prints.

perl -apple, 18 bytes

$F[0]&&chop;$_%=10

Try it online!

Prints the last digit of n for the special sequence (c = 0), otherwise, the penultimate digit of n. Perls DWIM magically makes it work for single digit inputs. ("" % 10 equals 0)

perl -apple, 18 bytes

$F[0]&&chop;$_%=10

Try it online!

Prints the last digit of n for the special sequence (c = 0), otherwise, the penultimate digit of n. It doesn't quite work for single digit n's, but since we only have to tend towards equal distribution, it doesn't matter what it prints.

Source Link

perl -apple, 18 bytes

$F[0]&&chop;$_%=10

Try it online!

Prints the last digit of n for the special sequence (c = 0), otherwise, the penultimate digit of n. Perls DWIM magically makes it work for single digit inputs. ("" % 10 equals 0)