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

 

jebbert@volusia.k12.fl.us > makeCube
prev  |  next  |  chance

You are building a rectangular solid out of 1 cm cubes. Each rectangular solid will have a length, width, and height. Determine if the cubes in that solid can be restacked in order to make a large cube (all three dimensions must be equal) using all of the 1 cm cubes from the original rectangular solid with no additional 1 cm cubes being used. The method makeCube will return the length of the resulting cube if one is possible. Return 0 if no cube can be made.


makeCube(100000, 1, 10) → 100
makeCube(11, 121, 1) → 11
makeCube(2000, 2, 2) → 20

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

public int makeCube(int a, int b, int c) { }

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: 480

Copyright Nick Parlante 2017 - privacy