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

Stats:

CreatedJan 14, 2016
PublishedJan 14, 2016
Warriors Trained905
Total Skips25
Total Code Submissions2391
Total Times Completed448
JavaScript Completions338
Ruby Completions121
Total Stars27
% of votes with a positive feedback rating89% of 140
Total "Very Satisfied" Votes119
Total "Somewhat Satisfied" Votes12
Total "Not Satisfied" Votes9
Total Rank Assessments15
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • tdowek1 Avatar
  • GiacomoSorbi Avatar
  • gabbek Avatar
  • Voile Avatar
Ad