learn
BAN USER
Questions (4)
Comments (3)
Followers (4)
Reputation 290
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
RepKinsleyJames, Network Engineer at Accenture
I graduated from College with a master’s degree in arthrogryposis. After graduation I am working as a manager in ...
RepJaneBraun, Associate at ASAPInfosystemsPvtLtd
Hi, I am Jane From York,PA.My goal is to create a life that I don’t want to ...
RepNatalieLutz, Applications Developer at Absolute Softech Ltd
Pitch trending story topics and continually look for ways to push breaking and/or viral stories forward with new angles ...
Repgarycsroka, Backend Developer at Axiom Sources
Hi I’m Gary, an average 19 year old in a state college who sees life as an adventure.Provide ...
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
this can be done with dp in o(n*max)
- learn October 21, 2016n-array size
max-maximum acceptable volume
explanation- my dp table will have (0 to max) rows and (0 to n-1) columns (initialise with -1)
fill first column by using initial volume(I) ie. update only dp[i-arr[0]][0] and dp[i+arr[0]] (dont forget to maintain the value within 0-max, otherwise -1) by using only positive values(say v) of first column update second column for v+arr[1] and v-arr[1] and so on till (n-1)th column
Ans will be the largest value from (n-1)th column