Maximum Sum with Capacity Constraints
Given an array of size N and an initial capacity integer K, find the maximum sum such that for each element chosen, decrement capacity by 1 and for each element not chosen, increment capacity by 1. Capacity cannot go below 0 or above K.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late August, 2024
Mid-level
Given an array of size N and an initial capacity integer K, find the maximum sum such that for each element chosen, decrement capacity by 1 and for each element not chosen, increment capacity by 1. Capacity cannot go below 0 or above K.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.