# Tag Info

Accepted

### Flatten the Array!

K, 3 bytes ,// This is a fairly common idiom. "Join over converge". try it here with oK. How it works: Join (,) fuses ...
• 5,062

### Flatten the Array!

JavaScript (ES6), 35 bytes Inspired by @user81655's answer: f=a=>a.map?[].concat(...a.map(f)):a
• 1,037
Accepted

### Is it true? Ask Jelly!

Jelly, 3 bytes ṭFẠ F flattens the input list. tacks on the original input list as an ...
• 3,664
Accepted

### Determine the depth of an array

K, 4 bytes #,/\ In K, ,/ will join all the elements of a list. The common idiom ,// ...
• 5,062

### Flatten the Array!

Mathematica, 16 14 bytes {##&@@#&//@#}& An unnamed function which takes and returns a list, e.g.: ...
• 196k

### Multiply numbers by their depth

Vyxal, 4 bytes ⁽L€* Try it Online! ...
• 12.3k

### Is it true? Ask Jelly!

Retina, 10 bytes A\b0 ^... Try it online! First we remove the input if it contains a zero. The we try to match at least three characters from the beginning of ...
• 196k
Accepted

### Make a list flat

Languages with built-ins HBL, 0.5: - - Try it online! Fig, ~0.823: f - Try it online! flax, 1: ...

### Determine the depth of an array

Retina, 10 Saved 1 byte thanks to @ӍѲꝆΛҐӍΛПҒЦꝆ Saved 14 extra bytes thanks to @MartinBüttner +\w|}{ { Here the input format is a bit contrived - _ characters ...
• 71.9k

### Compare shapeless lists

Brachylog, 3 bytes p↰ᵐ Try it online! Explanation This takes the first list as the input variable, and the second list as the output variable. The interpreter then ...
• 38.5k

### Is it a valid list?

JavaScript, 10 bytes JSON.parse Outputs via the presence or absence of an error. Try it online!
• 2,749

### Re-name all identifiers to a single letter

tinylisp, 149 bytes ...
• 38.4k

### Flatten the Array!

Python 2, 43 bytes f=lambda l:[l]*(l*0!=[])or sum(map(f,l),[]) On a list, recurses on the elements and concatenates the results. On a string or number, encases ...
• 144k

### B​u​i​l​d a n​e​s​t

Python, 153 128 bytes s=l=0;r="";n=input() for d in bin(n)[2:]*(n>0):c=d<"1";l=[l,s>1][c];r+="]"*c+(1-l*c)*"[";s+=1-c-l*c print"["+r+"["*l+"]"*(s+l+1) ...
• 39.1k

### Find the "Recursive Size" of a List

Python, 42 bytes f=lambda x:x*0==[]and len(x)+sum(map(f,x)) For a non-list, output 0. For a list, output its length plus the sum of the recursive outputs for its ...
• 144k

### Sort numbers in a ragged list

Jelly, 3 bytes FṢṁ Try it online! How it works ...
• 49.8k

### Determine the depth of an array

Python 2, 33 bytes f=lambda l:l>{}and-~max(map(f,l)) Recursively defines the depth by saying the depth of a number is 0, and the depth of a list is one more ...
• 144k

### B​u​i​l​d a n​e​s​t

Python 2.7, 172 149 124 118 bytes ...
• 1,958

### Is it true? Ask Jelly!

Ruby, 25 24 23 18 16 bytes p$_!~/\D0|^..$/ Requires the -n flag on the command line (+1 byte, ...
• 71.4k

JavaScript (V8), 48 bytes a=>f=b=>b[2]?b[[x,...r]=f(b.slice(1)),1]<f?x:r:a Try it online! -2 bytes thanks to @Arnauld!
• 11.2k

### Ragged list pattern matching

Elixir, 1 byte = Yes, Elixir's equality/pattern match operator functions exactly as requested when input is provided as plain code with wildcards indicated by ...
• 13.9k

Python 3, 68 66 54 bytes lambda r,s:eval(s[:0:-1].translate(["[1:]","[0]"]*51)) Try it online! Alt, similar idea (which works in Python 2): ...
• 1,241

### Reconstruct a recursively prime-encoded integer

Python 2, 42 bytes Thanks to @tsh for suggesting a 2-byte improvement f=lambda x=1,*a:x<2or-(x*-1or~f(*x))*f(*a) Try it online! ...
• 22.6k

### Find the maximum length in a ragged list

Python 2, 40 bytes f=lambda a:a>[]and max(len(a),*map(f,a)) Attempt This Online! Uses Python 2's global ordering: lists are all considered greater than ints. We can also use ...
• 23.5k

### Compare shapeless lists

Python 3, 49 bytes lambda x,y:g(x)==g(y) g=lambda a:sorted(map(g,a)) Try it online!
• 41.4k

### Make a list flat

Python 2, 39 bytes f=lambda s:[s]*(s<f)or sum(map(f,s),[]) Attempt This Online! Found independently but very similar to @xnor's answer to the linked question.
• 2,539

### Reverse an N-Dimensional array

Pyth, 11 - 50% = 5.5 bytes L?+IbY_yMbb Try it online: Demonstration or Test Suite. This defines a function y. The additional ...
• 21.9k

### Flatten the Array!

Ruby, 43 42 34 bytes Recursive solution. Now with exception handling! (might as well credit @akostadinov for inspiring the change though) ...
• 12.5k