Given a ragged array, find the length of the largest subarray that contains the depth of that subarray. The base array layer has a depth of 0.
Here is an example:
[1, 2, [3, 4, [2, 5]], 0]
Here, the subarray [2, 5] contains its own depth 2 and has a length of 2 as well.
But in the outermost subarray is a 0, its depth. The outermost subarray has a length of 4, which is greater than 2, so the output is 4.
Test Cases
[1, 2, [3, 4, [2, 5]], 0] => 4
[1, [2, 3], [[1]], [2, [2, 3]]] => 2
[1, 1, 1] => undefined (must not be a number >= 1)
Scoring
This is code-golf, so shortest code wins!