Company: Salesforce_17feb
Difficulty: medium
Salesforce Resource Allocation body { font-family: sans-serif; line-height: 1.6; color: #333; } h1 { color: #2c3e50; } h2 { color: #34495e; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 20px; } pre { background-color: #ecf0f1; padding: 10px; border-radius: 5px; overflow-x: auto; } code { background-color: #ecf0f1; padding: 2px 4px; border-radius: 3px; font-family: monospace; } ul { list-style-type: disc; margin-left: 20px; } li { margin-bottom: 5px; } Salesforce Resource Allocation Problem Description A Salesforce administrator is managing resource allocation across n regions for a marketing campaign. These regions are represented by an array arr of length n , where initially, each element of the array is set to 0 . The administrator needs to perform q updates on the array arr , following these rules: An update is specified as i x , where: i is the index of the primary region to which x units of resources are allocated. Neighboring regions also receive a portion of th