New answers tagged

0 votes

Number to Binary

*><>, 14 bytes Input is passed in through the -i flag. :2%:n-2,:0)?!; ...
Bee H.'s user avatar
  • 191
0 votes

Sum of Binary Substrings

Scala 2, 156 bytes A port of @DW.com's C# answer in Scala. 156 bytes, it can be golfed more. Golfed version. Attempt This Online! ...
138 Aspen's user avatar
  • 5,331
2 votes

Sum of Binary Substrings

Perl 5 -p, 53 bytes $\=-$_;$_=sprintf'%b',$_;/.*(?{$\+=oct"0b$&"})(?!)/}{ Try it online! ...
Xcali's user avatar
  • 14.2k
1 vote

Number to Binary

Labyrinth, 29 bytes ? ~:"" 2%!@ _ ( _ " 2/);("" Try it online! Handling zero input is nontrivial since loops in Labyrinth require a ...
Bubbler's user avatar
  • 74.9k
0 votes

Sum of Binary Substrings

Japt, 7 6 bytes n¢ã xÍ Try it ...
noodle man's user avatar
  • 6,121
1 vote

Sum of Binary Substrings

Vyxal 3 s, 6 bytes bṢḶṪᵛB Try it Online!
pacman256's user avatar
  • 3,300
0 votes

The first n numbers without consecutive equal binary digits

YASEPL, 39 bytes =n=a'(`1!b$2^n-*/3!s$b(}5,b,2+`2<!+}2,a explanation: ...
madeforlosers's user avatar
0 votes

The first n numbers without consecutive equal binary digits

Labyrinth, 22 bytes 1?+:_ }: 3 " !/ @({\ Try it online! Uses the "power of 2 divided by 3" formula. ...
Bubbler's user avatar
  • 74.9k
1 vote

Compact Binary Representation

Charcoal, 40 + 35 = 75 bytes Encoder, 40 bytes NθNηWθ«≔↨²E↨θ²∧λκζ¿›ηζ«1≧⁻⊕ζη≧⁻⊕ζθ»«0≔ζθ Try it online! Link is to verbose version of code. Explanation: ...
Neil's user avatar
  • 169k
3 votes

Compact Binary Representation

JavaScript (ES6), 65 + 67 = 132 bytes Encoder (65 bytes) Expects (x)(m) and returns a binary string. ...
Arnauld's user avatar
  • 191k
1 vote

Binary Countdown Length

Go, 172 bytes ...
bigyihsuan's user avatar
  • 8,978
1 vote

Binary Countdown Length

Vyxal 3 s, 3 bytes ½⊻b Try it Online! port of the jelly answer
pacman256's user avatar
  • 3,300
1 vote

Number to Binary

Uiua, 9 bytes SBCS &pf⇌⋯⋕&sc Try it online! Outputs as a list of bits. Explanation ...
Adelie's user avatar
  • 61
0 votes

Convert binary to unary

YASEPL, 65 bytes =d'=m=h$=o=u®"d"=k$u+`1!t$u-m!x¥t,"d"[2!o+h`2!h$2^m!m+}2,k;"1",o< 1 is the unary digit, prompts you for input ...
madeforlosers's user avatar
1 vote

Find the "Bittiest" Number

K4, 15 bytes Solution: {*x@>+/+0b\:'x} Explanation: Pretty much exactly the same as the ngn/k solution: ...
mkst's user avatar
  • 5,125
2 votes

Number to Binary

Perl 5, 13 bytes printf"%b",<> Try it online!
Xcali's user avatar
  • 14.2k
0 votes

Number to Binary

YASEPL, 76 bytes =d'(=y)""`9!m$d%!yſm!d/(}7,0,9=o-!h)""!u®"y"-=k$u`8!m¥u,"y"!hſm!u-}1,o,8>h YASEPL is a (horribly ...
madeforlosers's user avatar
0 votes

Binary representation of a number is palindrome or not?

Uiua SBCS, 22 bytes &p⊡≍⇌.⋯⋕&sc{"NO""YES"} Try it!
chunes's user avatar
  • 23.4k

Top 50 recent answers are included