Skip to main content
added 76 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

BQN, 1515 13 bytesSBCS

-2 bytes thanks to Razetime!

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจโ‰ โŒˆยด๐•ŠโŸ=ยจ)๐•ฉ;0ร—๐•ฉ} 

Run online!Run online!

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจโ‰ โŒˆยด๐•ŠโŸ=ยจ)๐•ฉ;0ร—๐•ฉ}  # Anonymous function taking the list as right argument ๐•ฉ =๐•ฉ ร—๐•ฉ # RankSign of theeach argument;number, 0converts forall intsnumbers andto 1 for lists   ?=๐•ฉ ยจ # IfFor theeach rankvalue isin 1:the list ๐•ŠโŸ= ๐•Šยจ ๐•ฉ # Recursivedo a recursive call onif eachit elementis a list (rank 1) โ‰ โŒˆยด  # Maximumand reductionreturn ofintegers theunchanged results(rank starting0)  with the length of ๐•ฉ โ‰ โŒˆยด # Maximum reduction of ;0the results #starting Otherwise:with Returnthe 0length of ๐•ฉ 

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

BQN, 15 bytesSBCS

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} 

Run online!

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} # Anonymous function taking the list as right argument ๐•ฉ =๐•ฉ # Rank of the argument; 0 for ints and 1 for lists   ? # If the rank is 1: ๐•Šยจ ๐•ฉ # Recursive call on each element โ‰ โŒˆยด # Maximum reduction of the results starting with the length of ๐•ฉ  ;0 # Otherwise: Return 0 

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

BQN, 15 13 bytesSBCS

-2 bytes thanks to Razetime!

{(โ‰ โŒˆยด๐•ŠโŸ=ยจ)ร—๐•ฉ} 

Run online!

{(โ‰ โŒˆยด๐•ŠโŸ=ยจ)ร—๐•ฉ}  # Anonymous function taking the list as right argument ๐•ฉ ร—๐•ฉ # Sign of each number, converts all numbers to 1 =๐•ฉ ยจ # For each value in the list ๐•ŠโŸ= # do a recursive call if it is a list (rank 1)   # and return integers unchanged (rank 0)  โ‰ โŒˆยด # Maximum reduction of the results starting with the length of ๐•ฉ 

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

added 388 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

BQN, 15 bytesSBCS

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} 

Run online!Run online!

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} # Anonymous function taking the list as right argument ๐•ฉ =๐•ฉ # Rank of the argument; 0 for ints and 1 for lists ? # If the rank is 1: ๐•Šยจ ๐•ฉ # Recursive call on each element โ‰ โŒˆยด # Maximum reduction of the results starting with the length of ๐•ฉ ;0 # Otherwise: Return 0 

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

BQN, 15 bytesSBCS

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} 

Run online!

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

BQN, 15 bytesSBCS

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} 

Run online!

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} # Anonymous function taking the list as right argument ๐•ฉ =๐•ฉ # Rank of the argument; 0 for ints and 1 for lists ? # If the rank is 1: ๐•Šยจ ๐•ฉ # Recursive call on each element โ‰ โŒˆยด # Maximum reduction of the results starting with the length of ๐•ฉ ;0 # Otherwise: Return 0 

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.

Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

BQN, 15 bytesSBCS

{=๐•ฉ?(โ‰ โŒˆยด๐•Šยจ)๐•ฉ;0} 

Run online!

or questionable 12 bytes:

{(โ‰ โŒˆยด๐•ŠโŽŠ0ยจ)๐•ฉ} 

Run online!

This relies on exceeding the maximum call stack size, which means this only works if such a limit exists and is larger than the maximum depth of the ragged list.