7 kyu
Homogenous arrays
3,198 of 4,307lilsweetcaligula
Description:
Challenge:
Given a two-dimensional array, return a new array which carries over only those arrays from the original, which were not empty and whose items are all of the same type (i.e. homogenous). For simplicity, the arrays inside the array will only contain characters and integers.
Example:
Given [[1, 5, 4], ['a', 3, 5], ['b'], [], ['1', 2, 3]], your function should return [[1, 5, 4], ['b']].
Addendum:
Please keep in mind that for this kata, we assume that empty arrays are not homogenous.
The resultant arrays should be in the order they were originally in and should not have its values changed.
No implicit type casting is allowed. A subarray [1, '2'] would be considered illegal and should be filtered out.
Arrays
Fundamentals
Functional Programming
Similar Kata:
Stats:
Created | Oct 1, 2016 |
Published | Oct 1, 2016 |
Warriors Trained | 5928 |
Total Skips | 48 |
Total Code Submissions | 12157 |
Total Times Completed | 4307 |
JavaScript Completions | 3198 |
Clojure Completions | 54 |
Python Completions | 1096 |
Total Stars | 66 |
% of votes with a positive feedback rating | 95% of 568 |
Total "Very Satisfied" Votes | 518 |
Total "Somewhat Satisfied" Votes | 43 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |