7 kyu

Is every value in the array an array?

3,390 of 5,300Peter Rhodes

Description:

Is every value in the array an array?

This should only test the second array dimension of the array. The values of the nested arrays don't have to be arrays.

Examples:

[[1],[2]] => true
['1','2'] => false
[{1:1},{2:2}] => false
[[1],[2]] => true
['1','2'] => false
[{1:1},{2:2}] => false
[[1],[2]] => true
['1','2'] => false
[{1=>1},{2=>2}] => false
[[1],[2]] => true
['1','2'] => false
[{1:1},{2:2}] => false
[[1], [2]] => true
["1", "2"] => false
[
  new class {
    public $one = 1;
  },
  new class {
    public $two = 2;
  }
] => false
Arrays
Fundamentals

Stats:

CreatedNov 16, 2016
PublishedNov 16, 2016
Warriors Trained6986
Total Skips125
Total Code Submissions12385
Total Times Completed5300
JavaScript Completions3390
Ruby Completions229
Python Completions1580
PHP Completions240
Crystal Completions16
Total Stars48
% of votes with a positive feedback rating93% of 891
Total "Very Satisfied" Votes786
Total "Somewhat Satisfied" Votes90
Total "Not Satisfied" Votes15
Total Rank Assessments10
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Peter Rhodes Avatar
  • omegahm Avatar
  • GiacomoSorbi Avatar
  • user8476848 Avatar
  • donaldsebleung Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad