id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

simona1@sfusd.edu two_d_arrays > isRectangular
prev  |  next  |  chance

Write a boolean method named isRectangular whose parameter is a string representing a two-dimensional array of int. isRectangular will return false if any of the rows of the array differ in length, otherwise true. Use method toArray() to change the String into an array. You must cut and paste method toArray() from the hint.


isRectangular("{{1,1,1},{1}}") → false
isRectangular("{{2,5},{1},{1,4}}") → false
isRectangular("{{3}}") → true

...Save, Compile, Run (ctrl-enter)

public boolean isRectangular(String s) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 330 Post-solution available

Copyright Nick Parlante 2017 - privacy