This is a verified interview question from Salesforce. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Maximizing Salesforce Opportunities - IIT Roorkee Salesforce Online Assessment" covers key patterns like DP.
"Given a Salesforce dashboard with n rows and m columns of opportunity data values, the following operation can be performed: 1. Select a non-empty row of the dashboard. 2. Remove an opportunity value either from the start or end of the selected row. If the first (starting) opportunity value of a row is removed, the next value in that row becomes the starting value. A similar logic applies when removing the last value of the row. Determine the maximum possible sum of opportunity values being removed after performing exactly k operations. Note that you need to maximize the sum of removed opportunity values not the remaining one's opportunity values. Note: The sum of removed opportunity values is to be returned rather than the sum of the remaining opportunity values. "
Join thousands of developers practicing for Salesforce.