Calculate Max Salary
Problem Overview
- Amazon interview question: compute the maximum total salary after at most one change to a single day’s office, using add/subtract rules based on later higher-priority offices.
- Input: string S listing offices A–E by day; Output: the maximum achievable salary as an integer.
- Context: optimizing a work schedule across five offices with fixed pay and priority.
- Salaries: A $1 < B $10 < C $100 < D $1,000 < E $10,000.
- A coding interview problem designed to assess sequence interpretation and optimization.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
