Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

New answers tagged

2 votes

Where are zeros? Self-describing sequence

Charcoal, 77 72 bytes NθNη≔⎇⁼θ²I⪪245¹⟦⁺³⁼³θ⟧υW‹Lυη«⊞υ⌈υ≔1ζW¬⁼⌕Aζ1Φυ‹λLζ≔⪫00⭆⊞Oυ⊕⊟υ⍘λ⭆θ¬νζ»I…υη Try it online! Link is to verbose version of code. Outputs the first ...
Neil's user avatar
  • 171k
1 vote

Sum of Binary Substrings

Ruby, 152 bytes 152 bytes, it can be golfed more. Golfed version. Attempt This Online! ...
138 Aspen's user avatar
  • 5,951
0 votes

16-bit binary grid

Scala 3, 220 bytes 220 bytes, it can be golfed more. Ungolfed version. Attempt This Online! ...
138 Aspen's user avatar
  • 5,951
1 vote

Sum of Binary Substrings

Go, 143 bytes ...
bigyihsuan's user avatar
  • 9,438
1 vote

Simplify binary

Jelly, 5 chars (8 bytes) ...
Aaron's user avatar
  • 171
1 vote

Simplify binary

Scala 3, 104 bytes A port of @xor's Python 2 answer in Scala. Golfed version. Attempt This Online! ...
138 Aspen's user avatar
  • 5,951
1 vote

Simplify binary

Perl 5 -p, 48 + 1 = 49 bytes $b=0;s/./$b=2*$b+$&/ge;$_=$b;y/01//c||$_<2||redo Try it online!
Xcali's user avatar
  • 15.1k
1 vote

Simplify binary

Vyxal 3, 14 bytes ᶪλf₀fṡ[|fṚÞỊE∑ Try it Online!
pacman256's user avatar
  • 4,035
1 vote

Simplify binary

Go, 123 bytes func f(n int)(o int){if n<2{return n} for i:=0;n>0;i++{o+=n%10<<i n/=10} for k:=o;k>0;k/=10{if k%10>1{return}} return f(o)} Attempt ...
bigyihsuan's user avatar
  • 9,438
2 votes

Simplify binary

R, 75 68 bytes -7 bytes by rewriting if and digit extraction (pajonk) ...
int 21h -- Glory to Ukraine --'s user avatar
1 vote

Hexadecimal to Binary

PowerShell Core, 74 bytes param($a)if($a-cmatch'^0x[0-9a-fA-F]+$'){[Convert]::ToString($a,2)}else{0} Try it online!
Julian's user avatar
  • 3,058

Top 50 recent answers are included