Minor note: Luckily the 'ε× isn't a dictionary word. If we would use € instead of ε it wouldn't work, because '€× is the dictionary word for "view".
Minor note: Luckily the 'ε× isn't a dictionary word. If we would use € instead of ε it wouldn't work, because '€× is the dictionary word for "view".
05AB1E, 14 bytes
ΔDgˆʒ˜gĀ}€`}¯à Try it online or verify all test cases.
Explanation:
Δ # Loop until the result no longer changes: D # Duplicate the current list g # Pop and push its length ˆ # Pop and add this to the global array ʒ # Filter the items within the list: ˜ # Flatten it g # Pop and push the length Ā # Check that this is not 0 } # After the filter: €` # Flatten the list one level down } # After the loop: ¯ # Push the global array with lengths à # Pop and push its maximum # (which is output implicitly as result) Bug-abuses the fact that ˜ gives an error on integers, causing them to be removed after the filter. Most errors in 05AB1E are simply ignored, which would be incorrect in this case, since the gĀ would result in a truthy result.
Could have been 13 bytes in the legacy version of 05AB1E if all integers were guaranteed to contain less digits than the intended result:
˜g'ε׿'g«€.VZ Try it online or verify all test cases.
˜ # Flatten the (implicit) input-list g # Pop and push its length 'ε× '# Push a string of that many "ε" æ # Pop and push the powerset of this string # (the prefixes would be enough, but that builtin doesn't include # an empty string which the powerset builtin does) 'g« '# Append a trailing "g" to each € # Map over each string .V # Execute it as 05AB1E code with the (implicit) input-list # (where `ε` is a map, and `g` pushes the length) Z # Push the flattened maximum of this list # (which is output implicitly as result) This unfortunately doesn't work if the integers are too big, because the εg would include the lengths of each inner integer in the resulting list of lists, which could potentially be larger than the intended result.
See that it fails if an input-number contains too many digits.