6 kyu
Are they square 2?
338 of 448tdowek1
Description:
Another Kata testing an whether all elements of an array are square, although this time the array can be a multidemtional array with any number of dimensions.
Your task - Write a function that checks whether all elements in a multidimensional array are square numbers. The function should be able to take any number of array elements and any number of dimensions.
Your function should return true if all elements are square numbers and false if not.
An entirely empty array should return undefined.
You can assume that all array elements will be positive integers.
Examples:
isSquare([1, 4, 9, 16, 25, 36]);
//returns true
isSquare([1, 2, 3, 4, 5, 6]);
//returns false
isSquare([1, [4], [9, 16, 25], [36, 49, [64, 81]], [100, [121, 144, [169]]], [196, [225, [256, 289, [324, [361, 400]]]]]]);
//returns true
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Jan 14, 2016 |
Published | Jan 14, 2016 |
Warriors Trained | 905 |
Total Skips | 25 |
Total Code Submissions | 2391 |
Total Times Completed | 448 |
JavaScript Completions | 338 |
Ruby Completions | 121 |
Total Stars | 27 |
% of votes with a positive feedback rating | 89% of 140 |
Total "Very Satisfied" Votes | 119 |
Total "Somewhat Satisfied" Votes | 12 |
Total "Not Satisfied" Votes | 9 |
Total Rank Assessments | 15 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |