[Question]
  [
A simple challenge for your Monday evening (well, or Tuesday morning in the other half of the world...)
You're given as input a nested, potentially ragged array of positive integers:
```
[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]
```
Your task is to determine its depth, which is the greatest nesting-depth of any integer in the list. In this case, the depth of `11` is `6`, which is largest.
You may assume that none of the arrays will be empty.
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.
Input may be taken in any convenient list or string format that supports non-rectangular arrays (with nested arrays of different depths), as long as the actual information isn't preprocessed.
You must not use any built-ins related to the shape of arrays (including built-ins that solve this challenge, that get you the dimensions of a nested array). The only exception to this is getting the length of an array.
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply.
### Test Cases
```
[1]                                                               -> 1
[1, 2, 3]                                                         -> 1
[[1, 2, 3]]                                                       -> 2
[3, [3, [3], 3], 3]                                               -> 3
[[[[1], 2], [3, [4]]]]                                            -> 4
[1, [[3]], [5, 6], [[[[8]]]], 1]                                  -> 5
[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14] -> 6
[[[[[[[3]]]]]]]                                                   -> 7
```
  
[Answer]
# K, 4 bytes
```
#,/\
```
In K, `,/` will join all the elements of a list. The common idiom `,//` iterates to a fixed point, flattening an arbitrarily nested list completely. `,/\` will iterate to a fixed point in a similar way, but gather a list of intermediate results. By counting how many intermediate results we visit before reaching the fixed point (`#`), we get the answer we want: the maximum nesting depth.
"Count of join over fixed-point scan".
In action:
```
 (#,/\)'(,1
        1 2 3
        ,1 2 3
        (3;(3;,3;3);3)
        ,((,1;2);(3;,4)))
1 1 2 3 4
```
[Answer]
# [Retina](https://github.com/mbuettner/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 are used for list separators, so an input would look like this `{1_{{2_3_{{4}_5}_6_{7_8}}_9_{10_{{{11}}}}_12_13}_14}`
* Stage 1 - repeatedly remove `}{` and all other `\w` characters. This has the effect of a) making all lists at all levels consist of only one element and b) removing all non-list-structural characters.
* Stage 2 - count remaining `{`. This gives the deepest level of nesting.
[Try it online.](http://retina.tryitonline.net/#code=K2Bcd3x9ewoKew&input=ezFfe3syXzNfe3s0fV81fV82X3s3Xzh9fV85X3sxMF97e3sxMX19fX1fMTJfMTN9XzE0fQ)
---
If that's too much of a stretch, then the previous answer was:
# [Retina](https://github.com/mbuettner/retina), 13
Assumes lists are contained in curly braces `{}`.
```
+`[^}{]|}{
{
```
[Try it online](http://retina.tryitonline.net/#code=K2BbXn17XXx9ewoKKHt9KikrCiQjMQ&input=ezEsIHt7MiwgMywge3s0fSwgNX0sIDYsIHs3LCA4fX0sIDksIHsxMCwge3t7MTF9fX19LCAxMiwgMTN9LCAxNH0).
[Answer]
## 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 than the maximum depth of its elements. Number vs list is checked by comparing to the empty dictionary `{}`, which falls above numbers but below lists on Python 2's arbitrary ordering of built-in types.
[Answer]
# Pyth - ~~11~~ ~~10~~ 7 bytes
*1 bytes saved thanks to @Dennis*
*4 bytes saved thanks to @Thomas Kwa*
```
eU.usNQ
```
[Try it online here](http://pyth.herokuapp.com/?code=eU.usNQ&input=%5B1%2C+%5B%5B3%5D%5D%2C+%5B5%2C+6%5D%2C+%5B%5B%5B%5B8%5D%5D%5D%5D%2C+1%5D++&debug=0).
Keeps on summing the array till it stops changing, which means its just a number, does this cumulatively to save all the intermediate results and gets length by making a urange with the same length as list and taking the last element.
[Answer]
## Haskell, 43 bytes
```
'['#x=x-1
']'#x=x+1
_#x=x
maximum.scanr(#)0
```
Usage example: `maximum.scanr(#)0 $ "[1, [[3]], [5, 6], [[[[8]]]], 1]"` -> `5`.
Haskell doesn't have mixed lists (`Integer` mixed with `List of Integer`), so I cannot exploit some list detection functions and I have to parse the string.
Im starting at the right with `0` and add 1 for every `]`, subtract 1 for every `[` and keep the value otherwise. `scanr` keeps all intermediate results, so `maximum` can do it's work. 
[Answer]
# Julia, ~~55~~ 26 bytes
```
f(a)=0a!=0&&maximum(f,a)+1
```
This is a recursive function that accepts a one-dimensional array with contents of type `Any` and returns an integer. When passing an array to the function, prefix all brackets with `Any`, i.e. `f(Any[1,Any[2,3]])`.
The approach is pretty simple. For an input *a*, we multiply *a* by 0 and check whether the result is the scalar 0. If not, we know that *a* is an array, so we apply the function to each element of *a*, take the maximum and add 1.
Saved 29 bytes thanks to Dennis!
[Answer]
# JavaScript (ES6), 35 bytes
```
f=a=>a[0]?Math.max(...a.map(f))+1:0
```
## Explanation
Recursive function that returns the maximum depth of an array, or `0` if passed a number.
```
var solution =
f=a=>
  a[0]?                   // if a is an array
    Math.max(...a.map(f)) // return the maximum depth of each element in the array
    +1                    // add 1 to increase the depth
  :0                      // if a is a number, return 0
// Test cases
result.textContent =
`[1]                                                              -> 1
[1, 2, 3]                                                         -> 1
[[1, 2, 3]]                                                       -> 2
[3, [3, [3], 3], 3]                                               -> 3
[[[[1], 2], [3, [4]]]]                                            -> 4
[1, [[3]], [5, 6], [[[[8]]]], 1]                                  -> 5
[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14] -> 6
[[[[[[[3]]]]]]]                                                   -> 7`
.split`\n`.map(t=>(c=t.split`->`.map(p=>p.trim()),c[0]+" == "+c[1]+": "+(solution(eval(c[0]))==c[1]?"Passed":"Failed"))).join`\n`
```
```
<input type="text" id="input" value="[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]" />
<button onclick="result.textContent=solution(eval(input.value))">Go</button>
<pre id="result"></pre>
```
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 11 ~~14 15~~ bytes
```
'}{'!=dYsX>
```
Curly braces are used in MATL for this type of arrays. Anyway, the input is taken and processed as a string, so square brackets could equally be used, modifying the two characters in the code.
[**Try it online!**](http://matl.tryitonline.net/#code=J317JyE9ZFlzWD4&input=J3sxLCB7ezIsIDMsIHt7NH0sIDV9LCA2LCB7NywgOH19LCA5LCB7MTAsIHt7ezExfX19fSwgMTIsIDEzfSwgMTR9Jw)
```
          % implicitly take input as a string (row array of chars)
'}{'!     % 2x1 (column) char array with the two curly brace symbols
=         % 2-row array. First / second row contains 1 where '}' / '{' is found
d         % second row minus first row
Ys        % cumulative sum of the array
X>        % maximum of the array
          % implicitly display result
```
[Answer]
# Jelly, ~~10~~ 7 bytes
```
¬;/SÐ¿L
```
[Try it online!](http://jelly.tryitonline.net/#code=wqw7L1PDkMK_TA&input=&args=WzEsIFtbMiwgMywgW1s0XSwgNV0sIDYsIFs3LCA4XV0sIDksIFsxMCwgW1tbMTFdXV1dLCAxMiwgMTNdLCAxNF0) or [verify all test cases](http://jelly.tryitonline.net/#code=wqw7L1PDkMK_TApbMV0sWzEsMiwzXSxbWzEsMiwzXV0sWzMsWzMsWzNdLDNdLDNdLFtbW1sxXSwyXSxbMyxbNF1dXV0sWzEsW1szXV0sWzUsNl0sW1tbWzhdXV1dLDFdLFsxLFtbMiwzLFtbNF0sNV0sNixbNyw4XV0sOSxbMTAsW1tbMTFdXV1dLDEyLDEzXSwxNF0sW1tbW1tbWzNdXV1dXV1dw4figqw&input=).
### How it works
```
¬;/SÐ¿L  Main link. Input: A (list)
¬        Negate all integers in A. This replaces them with zeroes.
    Ð¿   Cumulative while loop.
   S       Condition: Compute the sum of all lists in A.
                      If the sum is an integer, it will be zero (hence falsy).
 ;/        Body:      Concatenate all lists in A.
      L  Count the number of iterations.
```
### Update
While writing this answer, I noticed that Jelly behaves rather weirdly for ragged lists, because I calculated the depth of a list as the incremented *minimum* of depths of its items.
This has been addressed in the latest version, so the following code (**6 bytes**) would work now.
```
¬SSÐ¿L
```
This sums the rows of the array instead of concatenating them. 
[Answer]
# Octave, 29 bytes
```
@(a)max(cumsum(92-(a(a>90))))
```
Maps `[` to 1 and `]` to -1, then takes the max of the cumulative sum.
Input is a string of the form
```
S6 = '[1, [[3]], [5, 6], [[[[8]]]], 1]';
```
Sample run on [ideone](http://ideone.com/3LeGxV).
[Answer]
## Ruby, 53 bytes
```
i=0;p gets.chars.map{|c|i+=('] ['.index(c)||1)-1}.max
```
Input from STDIN, output to STDOUT.
```
i=0;                 initialize counter variable
p                    output to STDOUT...
gets                 get line of input
.chars               enumerator of each character in the input
.map{|c|             map each character to...
i+=                  increment i (and return the new value) by...
('] ['.index(c)||1)  returns 0 for ], 2 for [, 1 for anything else
-1                   now it's -1 for ], 1 for [, 0 for anything else
                     therefore: increment i on increase in nesting, decrement i
                       on decrease, do nothing otherwise
}.max                find the highest nesting level that we've seen
```
[Answer]
# Mathematica, 18 bytes
```
Max@#+1&//@(0#-1)&
```
[Answer]
# Mathematica, ~~27~~ 20 bytes
```
Max[#0/@#]+1&[0#]-1&
```
Simple recursive function.
[Answer]
# PHP, 61 bytes
```
function d($a){return is_array($a)?1+max(array_map(d,$a)):0;}
```
recursive function that uses itself as a mapping function to replace each element with its depth.
[Answer]
# PHP, ~~84~~ ~~72~~ ~~64~~ ~~63~~ 60 bytes
Note: requires PHP 7 for the combined comparison operator. Also uses IBM-850 encoding
```
for(;$c=$argv[1][$i++];)$c>A&&$t=max($t,$z+=~ú<=>$c);echo$t;
```
Run like this:
```
php -r 'for(;$c=$argv[1][$i++];)$c>A&&$t=max($t,$z+=~ú<=>$c);echo$t;' "[1, [[3]], [5, 6], [[[[8]]]], 1]"
```
* Saved 12 bytes by just counting braces of the string representation instead
* Saved 8 bytes by simplifying string comparisons and using ordinal number of the char in case of `[` and `]`
* Saved a byte by not casting `$i` to an int. String offsets are casted to an int implicitly
* Saved 3 bytes by using combined comparison operator instead of ordinal number
[Answer]
# [Haskell](https://www.haskell.org/) + [free](https://hackage.haskell.org/package/free-5.1.7/docs/Control-Monad-Free.html#t:Free), 29 bytes
Haskell doesn't have a built in ragged list type so we need to build one out of free monads from the [free](https://hackage.haskell.org/package/free-5.1.7/docs/Control-Monad-Free.html#t:Free) package.
```
iter((+1).maximum).fmap(*0)
```
[Try it online!](https://tio.run/##fVA9T8MwEN3zK26IhA2koh0r0glVYoKBDUXoaGxyInaqxIEM/e/hbCctGWBw5Pdx755TYfep6nrMMjjBg9JkyX6Aq6iDSrUKOrIHxViBbpUC05R9rYA6e@UAv5BqfGfcWHh5fEpKdAh779OACUAOzz1n@Osp8kKDmA1SJgnZziFvYIeAfW8PrmlBM5J8OGB3Jqcxz3/7ZkHXBo8cJcKaQUIeWIhrU1aGhS1E/LIFnEZZRJPkkYScamG7vRTyRbg6Qrbj3v47PyIwceBt6sGGfOaOFU1rjWcDPAv36Y7pUeeeEeJmLVcGBzK9kSvfRlzfydEg2bxsuPGxJevCq2Lia9i2LuTf2m38E5v/PYu0BdzMaGEpikvu@AM "Haskell – Try It Online")
[Answer]
# C, ~~98~~ 69 bytes
29 bytes off thanks [@DigitalTrauma](https://codegolf.stackexchange.com/users/11259/digital-trauma) !!
```
r,m;f(char*s){for(r=m=0;*s;r-=*s++==93)r+=*s==91,m=r>m?r:m;return m;}
```
Takes an *string* as input and return the result as integer.
Live example in: <http://ideone.com/IC23Bc>
[Answer]
## Python 3, ~~42~~ 39 bytes
*-3 bytes thanks to Sp3000*
This is essentially a port of [xnor's Python 2 solution](https://codegolf.stackexchange.com/a/71487/12914):
```
f=lambda l:"A"<str(l)and-~max(map(f,l))
```
Unfortunately, `[] > {}` returns an `unorderable types` error, so that particular clever trick of xnor's cannot be used. In its place, `-0123456789` are lower in ASCII value than `A`, which is lower than `[]`, hence the string comparison works.
[Answer]
## CJam (15 bytes)
```
q~{__e_-M*}h],(
```
[Online demo](http://cjam.aditsu.net/#code=q%7E%7B__e_-M*%7Dh%5D%2C(&input=%5B1%20%5B%5B2%203%20%5B%5B4%5D%205%5D%206%20%5B7%208%5D%5D%209%20%5B10%20%5B%5B%5B11%5D%5D%5D%5D%2012%2013%5D%2014%5D)
### Dissection
```
q~      e# Read line and parse to array
{       e# Loop...
  _     e#   Leave a copy of the array on the stack to count it later
  _e_-  e#   Remove a flattened version of the array; this removes non-array elements from
        e#   the top-level array.
  M*    e#   Remove one level from each array directly in the top-level array
}h      e# ...until we get to an empty array
],(     e# Collect everything together, count and decrement to account for the extra []
```
---
For the same length but rather more in ugly hack territory,
```
q'[,-{:~_}h],2-
```
[Answer]
# Sed, 40 characters
(39 characters code + 1 character command line option.)
```
s/[^][]+//g
:;s/]\[//;t
s/]//g
s/\[/1/g
```
Input: string, output: unary number.
Sample run:
```
bash-4.3$ sed -r 's/[^][]+//g;:;s/]\[//;t;s/]//g;s/\[/1/g' <<< '[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]'
111111
```
## Sed, 33 characters
(32 characters code + 1 character command line option.)
If trailing spaces are allowed in the output.
```
s/[^][]+//g
:;s/]\[//;t
y/[]/1 /
```
Input: string, output: unary number.
Sample run:
```
bash-4.3$ sed -r 's/[^][]+//g;:;s/]\[//;t;y/[]/1 /' <<< '[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]'
111111      
```
[Answer]
## [Hexagony](https://github.com/m-ender/hexagony), 61 bytes
*Edit*: Thanks @Martin Ender♦ for saving me 1 byte from the marvelous -1 trick!
```
|/'Z{>"-\..(.."/'&<'..{>-&,=+<$.{\$._{..><.Z=/...({=Z&"&@!-"
```
[Try it online to verify test cases!](http://hexagony.tryitonline.net/#code=fC8nWns-Ii1cLi4oLi4iLycmPCcuLns-LSYsPSs8JC57XCQuX3suLj48Llo9Ly4uLih7PVomIiZAIS0i&input=WzFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gMQpbMSwgMiwgM10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAxCltbMSwgMiwgM11dICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0-IDIKWzMsIFszLCBbM10sIDNdLCAzXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gMwpbW1tbMV0sIDJdLCBbMywgWzRdXV1dICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiA0ClsxLCBbWzNdXSwgWzUsIDZdLCBbW1tbOF1dXV0sIDFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0-IDUKWzEsIFtbMiwgMywgW1s0XSwgNV0sIDYsIFs3LCA4XV0sIDksIFsxMCwgW1tbMTFdXV1dLCAxMiwgMTNdLCAxNF0gLT4gNgpbW1tbW1tbM11dXV1dXV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiA3)
The images below are not modified but the flow is basically the same. Also note that this will return `-1` if the input is not an array (i.e. without `[]`).
I have lots of no-ops inside the Hexagon... I guess it can definitely be golfed more.
### Explanation
In brief, it adds `-1` when encounters a `[` and adds `1` when encounters a `]`. Finally it prints the max it has got.
Let's run along Test Case 5 to see its behaviour when it runs along the String `[1, [[3]], [5, 6], [[[[8]]]], 1]`:
It starts at the beginning and takes its input at the W corner:
[![Brackets](https://i.stack.imgur.com/ArKtR.png)](https://i.stack.imgur.com/ArKtR.png)
Since there is still input (not the null character `\0` or EOL), it wraps to the top and starts the crimson path. 
Here is what happens when from there till cute `><`:
`,` reads `[` into Buffer, and `{` and `Z` sets the constant Z to be 90. `'` moves to Diff and `-` calculates the difference. For `[` and `]` the difference will be `1` and `3` respectively. For numbers and spaces and commas it'll be negative.
[![M1](https://i.stack.imgur.com/7iwgY.png)](https://i.stack.imgur.com/7iwgY.png) [![M2](https://i.stack.imgur.com/ql94L.png)](https://i.stack.imgur.com/ql94L.png)
Then we run `(` twice (once at the end of crimson path, one at the start after wrapping at the green path) to get `-1` and `1` resp for `[` and `]`. Here we change the naming of `Diff` to `Value`. Add this Value to Depth. (I used `Z&` to ensure that it copies the right neighbor). Then we calculate `lastMin - Depth` and got a number on the Memory edge `minLR`.
Then we apply `&` (at the end of green path) to `minLR`: If the number is <=0, it copies the left value (i.e. `lastMin - Depth <= 0 => lastMin <= Depth`), otherwise it takes the right value.
We wraps to the horizontal blue path and we see `Z&` again which copies the `minLR`. Then we `"&` and made a copy of the calculated min. The brackets are assumed to be balanced, so the min must be <=0. After wrapping, the blue path go left and hit `(`, making the copy `1` less than the real min. Reusing the `-`, we created one more 1-off copy as a neighbor of Buffer:
[![M3](https://i.stack.imgur.com/N4VKi.png)](https://i.stack.imgur.com/N4VKi.png)
Note: `copy` is renamed as `1-off`
When blue path hits `\` and got a nice `"` and `<` catches it back to the main loop.
When the loop hits `1`, `,` or  or other numbers as input:
[![others](https://i.stack.imgur.com/dZVYh.png)](https://i.stack.imgur.com/dZVYh.png)[![M4](https://i.stack.imgur.com/JtTgJ.png)](https://i.stack.imgur.com/JtTgJ.png)
The Diff will become negative and it got reflected back to the main loop for next input.
When everything has gone through the main loop, we reach EOL which makes Buffer `-1` and it finally goes to the bottom edge:
[![M5](https://i.stack.imgur.com/8QmYR.png)](https://i.stack.imgur.com/8QmYR.png)
`'` moves the MP to the `1-off copy` and `)` increments it, and with `~` negation it got the correct Max Depth value which is printed with `!`
And the story ends with a `@`.
I guess I must have over complicating things a little bit. If I have had to only "move back" and "print" without incrementing and negation, I would have well saved 2 bytes without using the full Hexagon.
Great thanks to [Timwi](https://github.com/Timwi) for [Esoteric IDE](https://github.com/Timwi/EsotericIDE) and [Hexagony Colorer](https://github.com/Timwi/HexagonyColorer)!
[Answer]
## brainfuck, 48 bytes
```
,[<++[>-<------]>++[+[<]>>[-]]+<,]-[<[>+<-]>>]<.
```
Formatted:
```
,
[
  <++[>-<------]>++
  [
    not close paren
    +
    [
      not open paren
      <
    ]
    >>[-]
  ]
  +<,
]
-[<[>+<-]>>]
<.
```
Takes input formatted like `(1, ((3)), (5, 6), ((((8)))), 1)` and outputs a [byte value](http://meta.codegolf.stackexchange.com/questions/4708/can-numeric-input-output-be-in-the-form-of-byte-values/4719#4719).
[Try it online.](http://brainfuck.tryitonline.net/#code=LFs8KytbPi08LS0tLS0tXT4rK1srWzxdPj5bLV1dKzwsXS1bPFs-KzwtXT4-XTwu&input=KDEsICgoMiwgMywgKCg0KSwgNSksIDYsICg3LCA4KSksIDksICgxMCwgKCgoMTEpKSkpLCAxMiwgMTMpLCAxNCk&debug=on)
This stores the depth by memory location, moving the pointer right for `(` and left for `)` and ignoring other characters. Visited cells are marked with a `1` flag, so at the end of the main loop there will be `depth + 1` flags to the right of the current cell. These are then added to print the final result.
---
A previous 69-byte solution using a different approach:
```
,
[
  >>++[<<->>------]<-<++
  [
    not close paren
    >++<+
    [
      not open paren
      >-<[-]
    ]
  ]
  <
  [
    [>+>]
    <[<-<]
    >
  ]
  >>[<+> >+<-]
  ,
]
<.
```
In this version, the depth and max depth are stored explicitly in cells.
[Answer]
# [Io](http://iolanguage.org/), 53 bytes
Port of the JavaScript (ES6) answer.
```
f :=method(x,if(x type=="List",x map(i,f(i))max+1,0))
```
[Try it online!](https://tio.run/##TYxLDoMwDESvYrHyqF7gQr9SbtBLIJWolgigNov09GmgLFjY4zczsk05e7q70MfX9OQk5jlR/M69c9XDPrGSRKGb2cSzAaFLB5UayJ6HErMKrbquo1Cz5xZCpzLnzbwIXVH4trHW@/bfUmCpaPmlzXK0AM1vG@Mw5h8 "Io – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 64 bytes
```
d,l;f(char*s){return*s?l=d?d>l?d:l:0,d+=*s>90?92-*s:0,f(s+1):l;}
```
[Try it online!](https://tio.run/##VZBvi4MwDMbf@ymCIFSXgfXfpuL8IF5fDDs9wXPD7o6Dsc/uJa7stkJok@eXJ6Httm/bZdE4lp1oP49zYPzbfLp@z1Ng6rHStT6MtS7GIkS9qQJzyMM6j7aBoUInzEb6xVjel5/zoKG3DjhMV/j14eYAXGZKOuF6BirwtPC0/zG5CAaB2n0krnTujvN1HCbxaOmF20hFjCTJpggRQvxejBEeoViycvyUn01cjv7LJBAcKdudKLUSyeuwhkwZSBEyvunsmaPxzKbvLE/hOyE9pcgo2SHsmc/pLcPVQkprQbzkhWXCZtnras06WdmdduvfLH8 "C (gcc) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
ẎƬL
```
[Try it online!](https://tio.run/##y0rNyan8///hrr5ja3z@H25/1LTm6KSHO2f8/x/NxRltGKujQBlQ1rVTMASZpKNgpKNgTIF5MJPgRpFtFsgkI6BJxjoKEBwLcRnprgOZZAxyUzQ4qIxioSaaxMaS6DyQSSaQcIqOBvst2lRHwQxEA4EFxDyiogNkkinMJFBAgWgToE5TIDYDcsx1FCxAplkC2YYGYAsMDaEWANUbgoLBEKQBZJIZxHfRYEfFkuwtJDeZc8UCAA "Jelly – Try It Online")
This is a translation of [JohnE](https://codegolf.stackexchange.com/users/38485/johne)'s [K answer](https://codegolf.stackexchange.com/a/71494/66833).
`Ẏ` is the "tighten" command. When applied to a list, it "unwraps" each list in it, essentially reducing the depth by one. `Ƭ` repeated applies `Ẏ` to the input until it reaches a fixed point. We then count the number of iterations with `L`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 7 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
dΔ€`}N>
```
[Try it online](https://tio.run/##yy9OTMpM/f8/5dyUR01rEmr97P7/jzbUiY420jEGkiaxOqaxOmY60eY6FrGxOpY60YYGQOFoQ8NYINAxNNIxNAZSJrEA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/lHNTHjWtSaj1s/uv8z862jBWRyHaUMdIxxjEgLJATGMdMIrVgSCgHFixUSxY3CQ2NhaiMzoapD7aVMcMSAKBBVjGECYJNA5ImsTqmMbqmOlEm@sA5XUsdaINDUCqDQ0hqo10DIF2GJpA7YkGGwoBAA).
**Explanation:**
```
d     # Convert each integer in the (implicit) input-list to 1 (with a >=0 check)
 Δ    # Loop until the result no longer changes:
  €   #  Map over each inner item:
   `  #   Pop and dump its contents to the stack
 }N   # After the loop, push the last 0-based index
   >  # Increase it by 1 to make it a 1-based index
      # (which is output implicitly as result)
```
The `€`` basically flattens a list one level down, but will push its items in reversed order. E.g. [list `[[1,[2,3],4]]` will become `[4,[2,3],1]`](https://tio.run/##yy9OTMpM/f//UdOahP//o6MNdaKNdIxjdUxiYwE). In addition, it will do the same for multi-digit numbers, hence the need for the leading `d` to convert every integer to a single digit first. E.g. [list `[12,345,67]` will become `[2,1,5,4,3,7,6]`](https://tio.run/##yy9OTMpM/f//UdOahP//ow2NdIxNTHXMzGMB).
[Answer]
# [Whython](https://github.com/pxeger/whython), 28 bytes
```
f=lambda l:1+max(map(f,l))?0
```
[Attempt This Online!](https://ato.pxeger.com/run?1=RVBLCsIwEN17ilmmGKHTn7UgHiTMIiKhhfRDqahncdONeAkv4t6DmKSJBiYzk_fePCb356W-TXXfzfPjPKlN-VJ7LdvjSYKucN3KK2vlwBTXUXSIF8r7o_oRNDQdiBUIJG5vDgmH1NW_xnUp90EODxxhhZCQRzMiCoOEsFIQOYfCZnNKBwP-KdbA5sw85yYK02w5lJa2MzXGTonolYaP1h6z4C-cD3ljqlYAw9h0E1PMbLvsGr7lCw)
### Explanation
The depth of a list is the maximum depth of its elements; the depth of an integer is 0.
```
f=lambda l:1+max(map(f,l))?0
f=                            # Define f as
  lambda l:                   # a function of one argument, l:
                 map(f,l)     #  Call f recursively on each element of l
             max(        )    #  Take the maximum
           1+                 #  Add 1
                              #  If l is an integer, map raises an exception
                          ?0  #  Catch that exception and return 0
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 bytes
```
>0|↰ᵐ⌉+₁
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/6htw6Ompoe7Omsfbp3w386gBigAZD3q6dR@1NT4/390tGGsTrShjoKRjoIxkAVnAtnGOgoQHAuWg8iDNSgYxULlTGJjYyEGREeDNClEm@oomIFoILAASyoYwhSADAbRJkBBUyA2A3LMdRQsQIosgWxDA7A@Q0OoPqB6Q5DFhiYQm6PBdkAAAA "Brachylog – Try It Online")
```
 0|         Output 0
>           if the input is a positive integer;
  |↰ᵐ       else map this over the elements of the input
      +₁    and add 1 to
     ⌉      the largest result.
```
[Answer]
# Raku, 53 48 bytes
The closure:
```
{my $d;/[\[{$d++;$!=max $!,$d}|\]{$d--}|.]*/;$!}
```
Needs an argument, eg:
```
> {my $d;/[\[{$d++;$!=max $!,$d}|\]{$d--}|.]*/;$!}("[[[3]][2]]")
3
```
Explanation:
```
{                 # start outer IIFE closure;
  my $d;            # declare depth variable `$d`;
  /                 # start IIFE regex match;
    [                 # start (non-capturing) group;
                      # EITHER:
      \[                # match `[` in input; if successful then:
      {                 # start inner (within regex) IIFE closure;
        $d++;             # increment depth variable; and then:
        $! = max $!, $d   # (ab)use `$!` variable to track MAX depth;
      }                 # end inner IIFE closure;
    |                 # OR:
      \]                # match `[` in input; if successful then:
      {$d--}            # decrement depth variable in IIFE closure;
    |                 # OR:
      .                 # match one character;
    ]*                # end capture group; match zero or more times;
  /;                # end regex;
  $!                # max depth as last value in closure;
}                 # end outer closure, returning last value (max depth);
("[[[3]][2]]")    # pass string "[[[3]][2]]" as outer closure argument.
```
[Answer]
## Pyth, ~~15~~ 13 bytes
*-2 bytes by @Maltysen*
```
eSm-F/Ld`Y._z
```
Counts the difference between the cumulative counts of `[` and `]`, and takes the maximum. `Y` is the empty array, and its string representation (```) is conveniently `[]`.
Try it [here](http://pyth.herokuapp.com/?code=eSm-F%2FLd%60Y._z&input=%5B1%2C+%5B%5B2%2C+3%2C+%5B%5B4%5D%2C+5%5D%2C+6%2C+%5B7%2C+8%5D%5D%2C+9%2C+%5B10%2C+%5B%5B%5B11%5D%5D%5D%5D%2C+12%2C+13%5D%2C+14%5D&debug=0).
]