Calculate Max Salary
You work at a company that has 5 offices, each with a distinct salary level and a priority ranking from lowest to highest as follows: Office A ($1)<OfficeB($10)< Office C ($100)<OfficeD($1,000)< Office E($ 10,000). Your work schedule is represented by a string, where each character corresponds to an office (e.g., 'D' for Office D) you work on the ith day. Your salary is calculated based on the following rule:
Salary Calculation Rules:
The company allows you to change the office you work in, on any one day to maximise your total salary. Your task is to determine the maximum possible salary after making at most one such change.
Input Format
The first and only line contains a string S representing the sequence offices you worked in.
Output Format
Print the max salary you can get after changing at most one office to another office.