7 kyu
The real size of a multi-dimensional array
Description:
Challenge:
Given a multi-dimensional integer array, return the total number of integers, stored inside this array. You should not rely on the number of dimensions to solve this kata. If n is the number of dimensions, then: 1 <= n < +Infinity.
Example:
Given [[[5], 3], 0, 2, [], [4, [5, 6]]], your function should return a result of 7. This is because the array contains 7 integers.
Addendum:
Think of it as dimension-agnostic value counting. We want to know the total number of integers inside the array and we don't care for the dimensions.
Arrays
Recursion
Fundamentals
Similar Kata:
Stats:
Created | Oct 1, 2016 |
Published | Oct 1, 2016 |
Warriors Trained | 1124 |
Total Skips | 8 |
Total Code Submissions | 2224 |
Total Times Completed | 738 |
JavaScript Completions | 738 |
Total Stars | 21 |
% of votes with a positive feedback rating | 92% of 151 |
Total "Very Satisfied" Votes | 130 |
Total "Somewhat Satisfied" Votes | 17 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |