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

 

james.shockey@austinisd.org > beaverPond
prev  |  next  |  chance

beaverPond Benny Beaver Benny the Beaver is building a new pond. He wants a pond with the maximum volume of water. He will need to build two dams. During rainy seasons the water will top over the dams and fill the pond with water. In dry seasons both dams will maintain the water level in the pond. Benny has access to different points on a creek with nearby groves of lumbers of different height, but the trees in each grove limits the height of the dams at the different locations. Given an array where the


beaverPond([2, 7, 2]) → 4
beaverPond([2, 7, 2, 7]) → 14
beaverPond([1, 8, 6, 2, 5, 4, 8, 3]) → 40

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

public int beaverPond(int[] a){ }

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: 200 Post-solution available

Copyright Nick Parlante 2017 - privacy