Skip to main content

New answers tagged

1 vote

Digits in their lanes

Zsh, 50 bytes for i;{for j (\- {0..9})printf ${j/[^$i]/\ };echo} Try it online!
roblogic's user avatar
  • 4,012
1 vote

Digits in their lanes

Uiua, 24 bytes SBCS ∵◇(↘1⊏×°⊏⊸∈:⊂" -"+@0⇡10) Input is a boxed array of strings, output is a 2D array of strings. Try it online! Explanation ...
Adelie's user avatar
  • 231
1 vote

Construct a uInt from an array of bits

AWK, 42 bytes {for(i=NF;i;i--)s+=x?($i*2)^(x++):x++}$0=s Attempt This Online!
xrs's user avatar
  • 579
1 vote

Smallest palindrome divisible by the input

AWK, 74 bytes func f(n,r){return n?f(int(n/10),r*10+n%10):r}{for(x=$0;$0!=f($0);)$0+=x}1 reverse() - or better yet rev() - is the one function I'm always missing. ...
xrs's user avatar
  • 579
0 votes

Smallest palindrome divisible by the input

Uiua, 12 bytes ⍢⊸+(¬≍⇌.°⋕). Try this online! Explanation: ...
ErikDaParrot's user avatar
0 votes

Stay away from zero

BrainChild ASM, 6 bytes asm function f(int)->int{ xpopa cpyab notb addba xpusha ret } Adds the top of the X Stack to the logical not of ...
ATaco's user avatar
  • 11.2k
0 votes

Stay away from zero

Uiua, 2 bytes ↥1 Try this online! No need for explanation but here's one: ↥1 => determine maximum between n and 1
ErikDaParrot's user avatar
1 vote

Let's decrease the monotony

AWK, 64 bytes {for(x=1;i++<NF;$i==$(i+1)&&x&&x=0)if($i<$(i+1)&&x=-1)break}$0=x Prints 1, nothing, or -1. Try it online! ...
xrs's user avatar
  • 579
0 votes

Stay away from zero

CASIO BASIC (CASIO fx-9750GIII), 8 bytes ?→A A+Not A
madeforlosers's user avatar
0 votes

Stay away from zero

Uiua, 2 bytes ↥1 Try it! The ↥ maximum with 1.
nyxbird's user avatar
  • 1,019
2 votes

Minimal sparse rulers

JavaScript (ES7), 115 bytes Returns the \$n\$-th term. Adapted from my answer to this other challenge. ...
Arnauld's user avatar
  • 198k

Top 50 recent answers are included