Share Your Experience: Take the 2024 Developer Survey

Tag Info

Accepted

Should we be friends?

SWI-Prolog, 62 47 41 bytes X*Y:-X+Y;Y+X;X==Y. X?Y:-not(X*Y),X*Z,Y*Z. Prolog isn't too often useful, but when it is it's just beautiful. We'll use ...
• 39.1k

Is it a valid chemical?

Python 3, 61 60 59 58 51 bytes lambda x:len(x)-2<~sum(x)%2*all(x)*sum(x)/2>=max(x) Try it online! -1 thanks to @Kevin Cruijssen -7 thanks to @xnor Uses ...
• 10.5k

Get to the Zone!

JavaScript (ES6), 30 bytes Takes input as (N)(M). N=>g=M=>M>N?M%2-~g(M+1>>1):N-M Try it online! How? Instead of ...
• 193k

Is it bipartite?

Wolfram Language (Mathematica), 26 25 bytes Tr[#//.x_:>#.#.Clip@x]<1& Try it online! How it works Given an adjacency matrix A, we find the fixed ...
• 5,245

Somewhere On The Tube ...But On Which Lines?

ES6, Node.js / Chrome, 989 977 931 892 889 887 bytes ...
• 193k
Accepted

Somewhere On The Tube ...But On Which Lines?

Mathematica 8+, 266 bytes ...
• 466

Arranging Bubbles

Python 2, 92 87 bytes a=lambda n:n<2or sum((k%d<1)*d*a(d)*a(n-k)for k in range(1,n)for d in range(1,1+k))/~-n In plain english: to compute ...
• 39.1k

Hexcellent Minesweeping

7 5 vertices, 14 10 edges (Graph made with this online tool and paint.) A-F are our six nodes, and ...
• 26.2k

Is this Game of Go configuration fully alive?

JavaScript, 178 bytes ...
• 34.9k

Two-Coloring Overlapping Circles

Mathematica, 165 bytes ...
• 15.7k

Should we be friends?

PHP, 138 133 129 bytes PHP beats Mathematica - a rare occurence. ...
• 14.7k

Are these states connected?

Wolfram Language (Mathematica), 169 167 bytes ...
• 20.6k

• 59.5k

Detect round trips on a dodecahedron

Python 2, 79 bytes lambda s:all(n==reduce(lambda n,c:-~[n,n%3+n%4][c>'L']%5,s,n)for n in range(5)) Try it online! This uses the group-theoretic approach from ...
• 145k

Two-Coloring Overlapping Circles

JavaScript/SVG/HTML5, 219 bytes ...
• 171k
Accepted

Surface of the 3x3x3 cube as a graph

APL (Dyalog Classic), 34 30 bytes -4 thanks to jimmy23013 4≥+/¨|∘.-⍨,(⍳3)∘.⌽7 ¯1∘.,○⍳3 3 Try it online! outputs an adjacency matrix with each vertex adjacent ...
• 15.3k
Accepted

Complete the grid-filling meander

JavaScript (ES7),  236 ... 193  185 bytes Outputs by modifying the input matrix. ...
• 193k
Accepted

Count all binary relations

APL (Dyalog Extended), 99 93 bytes r←0∊0 0⍉⊢ R←r~ s←⊢≢⍉ S←1∊⊢∧⍉ t←0∊⊢≥∨.∧⍨ T←1∊⊢∧∨.∧⍨ {×⍵:+/∧⌿~(⍺,'0'){(⍎⍺)⊣⍵}\⍵-⍛↑∘⊤¨,⍳⍵⍴2*⍵⋄1} Try it online! -5 bytes thanks to ...
• 76.7k