7 kyu

Find the max depth in an array

Description:

Write a method that finds the max depth in the array.

i.e.

[] should return 1
[1] should return 1
[1, 2] should return 1
[1, [2]] should return 2
[1, [2, 2]] should return 2
[1, [2, [3]]] should return 3
[1, [2, [3, [4], 3]]] should return 4
[1, [[], [3, [], 3]]] should return 4
[1, [[], [3, [[]], 3]]] should return 5
Arrays

Stats:

CreatedSep 9, 2014
PublishedSep 9, 2014
Warriors Trained435
Total Skips24
Total Code Submissions548
Total Times Completed149
Ruby Completions149
Total Stars17
% of votes with a positive feedback rating94% of 64
Total "Very Satisfied" Votes58
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes2
Ad
Contributors
  • franciscodelgadodev Avatar
  • smile67 Avatar
Ad