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

 

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

Write a method that returns the maximum product resulting from splitting a number into two parts. For example, 9004 could be split into 9*004, 90*40, or 900*4. The largest of these is 900*4 which is 3600. So the maxProduct of 9004 is 3600. Look at the test data for other examples. You are allowed to do this recursively, but recursion is NOT required.


feb13_2020_HL_maxProduct(987532) → 787788
feb13_2020_HL_maxProduct(832) → 256
feb13_2020_HL_maxProduct(94218) → 75368

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

public int feb13_2020_HL_maxProduct(int num) { }

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

Copyright Nick Parlante 2017 - privacy